Skip to content

Commit

Permalink
Change: write test result into build
Browse files Browse the repository at this point in the history
  • Loading branch information
eight04 committed Dec 7, 2017
1 parent 15bc13b commit 76cb42b
Showing 1 changed file with 11 additions and 15 deletions.
26 changes: 11 additions & 15 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,26 +50,22 @@ def iter_frames(dir):
im = APNG()
for png, ctrl in iter_frames(dir):
im.append(png, **ctrl)
# pngcheck can't work with stdin PIPE?
# stdin cannot read PNG or MNG signature
with tempfile.TemporaryDirectory() as tempdir:
filename = "{}-animated.png".format(dir.stem)
im.save(pathlib.Path(tempdir).joinpath(filename))
subprocess.run(
["pngcheck", filename],
cwd=tempdir, shell=True, check=True
)
filename = "{}-animated.png".format(dir.stem)
im.save(pathlib.Path("build").joinpath(filename))
subprocess.run(
["pngcheck", filename],
cwd="build", shell=True, check=True
)

def test_disassemble(self):
for dir in pathlib.Path("test").iterdir():
with self.subTest(dir.stem):
im = APNG.open(dir.joinpath("animated.png"))
for i, (png, ctrl) in enumerate(im.frames):
with tempfile.TemporaryDirectory() as tempdir:
filename = "{}-{}.png".format(dir.stem, i + 1)
png.save(pathlib.Path(tempdir).joinpath(filename))
subprocess.run(
["pngcheck", filename],
cwd=tempdir, shell=True, check=True)
filename = "{}-{}.png".format(dir.stem, i + 1)
png.save(pathlib.Path("build").joinpath(filename))
subprocess.run(
["pngcheck", filename],
cwd="build", shell=True, check=True)

main()

0 comments on commit 76cb42b

Please sign in to comment.