Total Complexity | 3 |
Total Lines | 23 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | from django.test import TestCase |
||
2 | import subprocess |
||
3 | import unittest |
||
4 | |||
5 | |||
6 | def mocha_exists(): |
||
7 | try: |
||
8 | subprocess.call(["mocha-phantomjs", "-V"]) |
||
9 | return True |
||
10 | except OSError: |
||
11 | return False |
||
12 | |||
13 | |||
14 | class JavaScriptTestCase(TestCase): |
||
15 | |||
16 | """ |
||
17 | Call JavaScript test framework to do the job. |
||
18 | """ |
||
19 | @unittest.skipUnless(mocha_exists(), "requires mocha-phantomjs") |
||
20 | def testJavaScriptCode(self): |
||
21 | subprocess.call( |
||
22 | ["mocha-phantomjs", "FuzzEd/tests/js-tests/src/test_runner.html"]) |
||
23 |