Пример #1
0
def test_scale_needs_scale(tmpdir):
    baseline_path = utils.get_baseline_path('scale_needs_scale.png')
    p = utils.create_project(tmpdir, 'p', 2, 2, 3)
    utils.copy_input('scale_needs_scale.png', p.orig_path)

    partition_image(p)

    assert filecmp.cmp(baseline_path, p.partitioned_path) is True
Пример #2
0
def test_crop_noop(tmpdir):
    baseline_path = utils.get_baseline_path('crop_noop.png')
    p = utils.create_project(tmpdir, 'p', 1, 1, 3)
    utils.copy_input('crop_noop.png', p.orig_path)

    partition_image(p)

    assert filecmp.cmp(baseline_path, p.partitioned_path) is True
Пример #3
0
def test_gridify_groups(tmpdir):
    baseline1 = utils.get_baseline_path('gridify_groups_trans.png')
    baseline2 = utils.get_baseline_path('gridify_groups_color.png')
    p = utils.create_project(tmpdir, 'p', 2, 2, 3)
    utils.copy_input('gridify_groups.png', p.orig_path)

    partition_image(p)

    assert filecmp.cmp(baseline1, p.partitioned_path) is True
    assert filecmp.cmp(baseline2, p.gridified_path) is True
Пример #4
0
def test_partition_missing_input(tmpdir):
    p = utils.create_project(tmpdir, 'p', 50, 50, 3)

    with pytest.raises(ValueError):
        partition_image(p)
Пример #5
0
 def partition(self, project_name):
     project = Project(os.path.join(self._root, project_name))
     partition_image(project)