def test_synth_positions_small_height(): """Fail in synth_positions because of small backgound height""" background = Image.new('RGB', (20, 20)) patch_1 = Image.new('RGB', (10, 21)) patch_2 = Image.new('RGB', (10, 21)) parameters = {'data': [background, patch_1, patch_2]} positions = images.synth_positions(parameters)
def test_synth_positions(): """Check synth positions with a large background and small patches""" background = Image.new('RGB', (30, 20)) patch_1 = Image.new('RGB', (10, 10)) patch_2 = Image.new('RGB', (20, 5)) parameters = {'data': [background, patch_1, patch_2]} positions = images.synth_positions(parameters) assert_equal(positions[0][0], 0) assert_equal(positions[0][1], 5) assert_equal(positions[1][0], 10) assert_equal(positions[1][1], 5)