Completed
Push — master ( db2bdb...52f8b4 )
by Amresh
01:56 queued 46s
created

TestCompileTestsCreateTestClass.test__create_test_class__E0716D7375()   A

Complexity

Conditions 1

Size

Total Lines 9
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 9
rs 10
c 0
b 0
f 0
cc 1
nop 1
1
from fastest.constants import TestBodies
2
from fastest.test_compiler.compile_tests import add_imports_for_test_case
3
from fastest.test_compiler.compile_tests import create_test_class
4
import unittest
5
6
class TestCompileTestsAddImportsForTestCase(unittest.TestCase):
7
    def test__add_imports_for_test_case__F0955CF53A(self):        
8
        empty_test = { 'imports': None }
9
        test = { 'imports': ['from datetime import datetime'] }
10
        imports = {'import numpy as np'}
11
        updated_imports = {'import numpy as np', 'from datetime import datetime'}
12
        
13
14
        self.assertEqual(add_imports_for_test_case(empty_test, imports), imports)
15
    def test__add_imports_for_test_case__2DBB5AB4A8(self):        
16
        empty_test = { 'imports': None }
17
        test = { 'imports': ['from datetime import datetime'] }
18
        imports = {'import numpy as np'}
19
        updated_imports = {'import numpy as np', 'from datetime import datetime'}
20
        
21
22
        self.assertEqual(add_imports_for_test_case(test, imports), updated_imports)
23
24
class TestCompileTestsCreateTestClass(unittest.TestCase):
25
    def test__create_test_class__E0716D7375(self):        
26
        imports = {'import random'}
27
        contents = ['']
28
        deps_import = 'fastest/__main__'
29
        function_object = TestBodies.MOCK_FUNCTION_OBJECT
30
        root_module_name = 'fastest'
31
        
32
33
        self.assertEqual(create_test_class(imports, contents, deps_import, function_object, root_module_name), TestBodies.CREATE_TEST_CLASS_RESULT)
34