tests: implemented multiple tileset tests

This commit is contained in:
Darren Eberly
2020-06-04 21:23:11 -04:00
parent 5c519bde9e
commit e2157ffa20
8 changed files with 167 additions and 7 deletions

View File

@@ -0,0 +1,18 @@
from pathlib import Path
from pytiled_parser import tileset
expected = tileset.TileSet(
columns=8,
image=Path(r"..\/..\/maps\/images\/tmw_desert_spacing.png"),
image_height=199,
image_width=265,
margin=1,
spacing=1,
name="tile_set_image",
tile_count=48,
tiled_version="1.3.1",
tile_height=32,
tile_width=32,
version=1.2,
)

View File

@@ -1,14 +1,22 @@
{ "columns":8,
"image":"..\/images\/tmw_desert_spacing.png",
"editorsettings":
{
"export":
{
"format":"",
"target":"."
}
},
"image":"..\/..\/maps\/images\/tmw_desert_spacing.png",
"imageheight":199,
"imagewidth":265,
"margin":1,
"name":"tile_set_image",
"spacing":1,
"tilecount":48,
"tiledversion":"1.3.1",
"tiledversion":"1.3.5",
"tileheight":32,
"tilewidth":32,
"type":"tileset",
"version":1.2
}
}

View File

@@ -0,0 +1,20 @@
from pathlib import Path
from pytiled_parser import tileset
from pytiled_parser.common_types import Color
expected = tileset.TileSet(
columns=8,
image=Path(r"..\/..\/maps\/images\/tmw_desert_spacing.png"),
image_height=199,
image_width=265,
margin=1,
spacing=1,
name="tile_set_image",
tile_count=48,
tiled_version="1.3.1",
tile_height=32,
tile_width=32,
version=1.2,
background_color=Color("#5500ff"),
)

View File

@@ -0,0 +1,23 @@
{ "backgroundcolor":"#5500ff",
"columns":8,
"editorsettings":
{
"export":
{
"format":"",
"target":"..\/image"
}
},
"image":"..\/images\/tmw_desert_spacing.png",
"imageheight":199,
"imagewidth":265,
"margin":1,
"name":"tile_set_image",
"spacing":1,
"tilecount":0,
"tiledversion":"1.3.5",
"tileheight":32,
"tilewidth":32,
"type":"tileset",
"version":1.2
}

View File

@@ -1,12 +1,20 @@
{ "columns":8,
"image":"..\/images\/tmw_desert_spacing.png",
"editorsettings":
{
"export":
{
"format":"",
"target":"."
}
},
"image":"..\/..\/maps\/images\/tmw_desert_spacing.png",
"imageheight":199,
"imagewidth":265,
"margin":1,
"name":"tile_set_image",
"spacing":1,
"tilecount":5,
"tiledversion":"1.3.1",
"tilecount":48,
"tiledversion":"1.3.5",
"tileheight":32,
"tiles":[
{
@@ -189,4 +197,4 @@
"tilewidth":32,
"type":"tileset",
"version":1.2
}
}

View File

@@ -0,0 +1,48 @@
{ "columns":8,
"editorsettings":
{
"export":
{
"format":"",
"target":"..\/image"
}
},
"image":"..\/..\/maps\/images\/tmw_desert_spacing.png",
"imageheight":199,
"imagewidth":265,
"margin":1,
"name":"tile_set_image",
"properties":[
{
"name":"bool property",
"type":"bool",
"value":true
},
{
"name":"color property",
"type":"color",
"value":"#ff0000ff"
},
{
"name":"float property",
"type":"float",
"value":5.6
},
{
"name":"int property",
"type":"int",
"value":5
},
{
"name":"string property",
"type":"string",
"value":"testing"
}],
"spacing":1,
"tilecount":48,
"tiledversion":"1.3.5",
"tileheight":32,
"tilewidth":32,
"type":"tileset",
"version":1.2
}

View File

@@ -0,0 +1,20 @@
from pathlib import Path
from pytiled_parser import tileset
from pytiled_parser.common_types import Color
expected = tileset.TileSet(
columns=8,
image=Path(r"..\/..\/maps\/images\/tmw_desert_spacing.png"),
image_height=199,
image_width=265,
margin=1,
spacing=1,
name="tile_set_image",
tile_count=48,
tiled_version="1.3.1",
tile_height=32,
tile_width=32,
version=1.2,
transparent_color=Color("#ff00ff"),
)

View File

@@ -0,0 +1,15 @@
{ "columns":8,
"image":"..\/..\/maps\/images\/tmw_desert_spacing.png",
"imageheight":199,
"imagewidth":265,
"margin":1,
"name":"tileset",
"spacing":1,
"tilecount":48,
"tiledversion":"1.3.5",
"tileheight":32,
"tilewidth":32,
"transparentcolor":"#ff00ff",
"type":"tileset",
"version":1.2
}