Skip to content

Commit

Permalink
Clean up with helper func
Browse files Browse the repository at this point in the history
  • Loading branch information
justvanrossum committed Sep 3, 2023
1 parent 7fc1987 commit a0d35df
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions test-py/test_backend_designspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,26 +210,29 @@ async def test_newFileSystemBackend(tmpdir, testFont):
dsPath = tmpdir / "Test.designspace"
font = newFileSystemBackend(dsPath)
assert [] == await font.getGlobalAxes()
files = sorted(p.name for p in tmpdir.iterdir())
assert ["Test.designspace", "Test_Regular.ufo"] == files
assert ["Test.designspace", "Test_Regular.ufo"] == fileNamesFromDir(tmpdir)

axes = await testFont.getGlobalAxes()
await font.putGlobalAxes(axes)
glyphMap = await testFont.getGlyphMap()
glyph = await testFont.getGlyph("A")
await font.putGlyph("A", glyph, glyphMap["A"])

glyphFiles = sorted(
p.name for p in (tmpdir / "Test_Regular.ufo" / "glyphs").iterdir()
assert ["A_.glif", "contents.plist"] == fileNamesFromDir(
tmpdir / "Test_Regular.ufo" / "glyphs"
)
assert ["A_.glif", "contents.plist"] == glyphFiles

assert [
"Test.designspace",
"Test_BoldCondensed.ufo",
"Test_BoldWide.ufo",
"Test_LightWide.ufo",
"Test_Regular.ufo",
] == sorted(p.name for p in (tmpdir).iterdir())
] == fileNamesFromDir(tmpdir)


def fileNamesFromDir(path):
return sorted(p.name for p in path.iterdir())


def unpackSources(sources):
Expand Down

0 comments on commit a0d35df

Please sign in to comment.