-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathtest.py
More file actions
executable file
·30 lines (22 loc) · 893 Bytes
/
test.py
File metadata and controls
executable file
·30 lines (22 loc) · 893 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env python3
import os
import subprocess
import sys
import tempfile
import unittest
import pytest
class Test(unittest.TestCase):
@pytest.mark.skipif(os.path.expandvars("${HOME}") == "${HOME}",
reason="cache_dir requires $HOME to be set")
def testGenerateMandelbrot(self):
with tempfile.TemporaryDirectory(prefix="fract4d_") as tmpdir:
test_file = os.path.join(tmpdir, "test.png")
subprocess.run([
os.path.join(os.path.dirname(sys.modules[__name__].__file__),
"gnofract4d"), "--nogui", "-s", test_file,
"--width", "24", "-j", "12", "-q"], check=True)
self.assertTrue(os.path.exists(test_file))
def suite():
return unittest.defaultTestLoader.loadTestsFromTestCase(Test)
if __name__ == '__main__':
unittest.main(defaultTest='suite')