Skip to content

Commit

Permalink
Merge pull request #67 from fossasia/kniteditor-adaptions
Browse files Browse the repository at this point in the history
Kniteditor adaptions
  • Loading branch information
niccokunzmann committed Aug 21, 2016
2 parents 4974da4 + 77521ad commit 67f759d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion knittingpattern/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# there should be no imports

#: the version of the knitting pattern library
__version__ = '0.1.18'
__version__ = '0.1.19'

#: an empty knitting pattern set as specification
EMPTY_KNITTING_PATTERN_SET = {"version": "0.1", "type": "knitting pattern",
Expand Down
12 changes: 6 additions & 6 deletions knittingpattern/convert/test/test_save_as_svg.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ def is_close_to(v1, v2, relative_epsilon=0.01):


@fixture(scope="module")
def patterns():
def patterns_svg():
return load_from_relative_file(__name__, "test_patterns/block4x4.json")


@fixture(scope="module")
def path(patterns):
return patterns.to_svg(zoom=DEFAULT_ZOOM).temporary_path(".svg")
def path(patterns_svg):
return patterns_svg.to_svg(zoom=DEFAULT_ZOOM).temporary_path(".svg")


@fixture(scope="module")
Expand Down Expand Up @@ -57,7 +57,7 @@ def test(instructions):
def instructions_svg_test(function):
def test(instructions):
for instruction in instructions:
function(instruction, svg, path, patterns)
function(instruction, svg, path, patterns_svg)
return test


Expand Down Expand Up @@ -107,8 +107,8 @@ def test_instructions_content_is_knit_svg_file(instruction):


@instructions_svg_test
def test_instructions_have_transform(instruction, svg, path, patterns):
def test_instructions_have_transform(instruction, svg, path, patterns_svg):
transform = instruction["transform"]
x, y, zoom = map(float, re.match(TRANSFORM_REGEX, transform).groups())
bbox = list(map(float, svg(path(patterns()))["viewBox"].split()))
bbox = list(map(float, svg(path(patterns_svg()))["viewBox"].split()))
assert is_close_to(DEFAULT_ZOOM / (bbox[3] - bbox[1]), zoom), ZOOM_MESSAGE
File renamed without changes.

0 comments on commit 67f759d

Please sign in to comment.