def test_read_filename_arguments_anonymous(): filename = "test.interleave.blah.2bpp" parsed_args = gfx.read_filename_arguments(filename) assert True == parsed_args["interleave"] assert True == parsed_args["blah"]
def test_read_filename_arguments_empty_args(): filename = "test....2bpp" parsed_args = gfx.read_filename_arguments(filename) assert 0 == len(parsed_args)
def test_read_filename_arguments_bad_dimensions(): filename = "test.16x4x3.2bpp" parsed_args = gfx.read_filename_arguments(filename) assert 'pic_dimensions' not in parsed_args
def test_read_filename_arguments_dimensions(): filename = "test.16x48.2bpp" parsed_args = gfx.read_filename_arguments(filename) assert (16, 48) == parsed_args['pic_dimensions']
def test_read_filename_arguments_arrange(): filename = "test.arrange.2bpp" parsed_args = gfx.read_filename_arguments(filename) assert True == parsed_args['norepeat'] assert True == parsed_args['tilemap']
def test_read_filename_arguments_int_args(): filename = "test.w16.h8.t4.2bpp" parsed_args = gfx.read_filename_arguments(filename) assert 16 == parsed_args['width'] assert 8 == parsed_args['height'] assert 4 == parsed_args['tile_padding']
def test_read_filename_arguments_4_args(): filename = "test.w16.h16.anonymous.arg.2bpp" expected = 4 parsed_args = gfx.read_filename_arguments(filename) assert expected == len(parsed_args)