-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathmodule.py
More file actions
43 lines (34 loc) · 1.4 KB
/
Copy pathmodule.py
File metadata and controls
43 lines (34 loc) · 1.4 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
import os
import unittest
from . import PlotDeviceTestCase, reference
from subprocess import check_output, STDOUT
from plotdevice import *
sdist_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
class ModuleTests(PlotDeviceTestCase):
def test_pyobjc(self):
import objc
self.assertIn(sdist_path, objc.__file__)
@reference('module/nodebox-compat.png')
def test_nodebox_compat(self):
code = open('%s/tests/_in/compliance/nodebox.py'%sdist_path).read()
os.chdir('%s/tests/_in/compliance'%sdist_path)
exec(code, _ctx._ns.copy())
os.chdir(sdist_path)
@reference('module/compliance.png')
def test_compliance(self):
code = open('%s/tests/_in/compliance/plotdevice.py'%sdist_path).read()
os.chdir('%s/tests/_in/compliance'%sdist_path)
exec(code, _ctx._ns.copy())
os.chdir(sdist_path)
def test_cli(self):
self._image = 'module/cli.png'
plod_bin = '%s/app/plotdevice'%sdist_path
script = '%s/tests/_in/cli.pv'%sdist_path
output = '%s/tests/_out/%s'%(sdist_path, self._image)
check_output([plod_bin, script, '--export', output], stderr=STDOUT, cwd=sdist_path)
self.render(save_output=False)
def suite():
from unittest import TestSuite, defaultTestLoader
suite = TestSuite()
suite.addTest(defaultTestLoader.loadTestsFromTestCase(ModuleTests))
return suite