ore.tests.test_js   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 15
dl 0
loc 23
rs 10
c 0
b 0
f 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A mocha_exists() 0 6 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A JavaScriptTestCase.testJavaScriptCode() 0 4 1
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