Passed
Push — master ( 2ef001...6551ad )
by Jan
03:14 queued 11s
created

test_JsTree   A

Complexity

Total Complexity 12

Size/Duplication

Total Lines 119
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 63
dl 0
loc 119
rs 10
c 0
b 0
f 0
wmc 12

12 Functions

Rating   Name   Duplication   Size   Complexity  
A test_create_node_with_negation_dict_for_JsTree1() 0 9 1
A test_create_node_dict_for_JsTree_2() 0 9 1
A test_transformation_tree_to_Json_for_JsTree_with_duplicated_test() 0 7 1
A test_create_node_dict_for_JsTree_5() 0 6 1
A test_create_node_dict_for_JsTree_0() 0 4 1
A test_create_node_with_negation_dict_for_JsTree() 0 9 1
A test_create_node_dict_for_JsTree_3() 0 6 1
A test_create_node_dict_for_JsTree_4() 0 6 1
A test_create_node_with_negation_dict_for_JsTree3() 0 10 1
A test_create_node_with_negation_dict_for_JsTree2() 0 10 1
A test_transformation_tree_to_Json_for_JsTree_0() 0 7 1
A test_create_node_dict_for_JsTree_1() 0 9 1
1
import tests.any_test_help
2
import graph.oval_graph
3
4
5
def test_create_node_dict_for_JsTree_0():
6
    src = 'test_JsTree_data/JsTree_data_0.json'
7
    Tree = tests.any_test_help.get_simple_tree()
8
    tests.any_test_help.any_test_create_node_dict_for_JsTree(Tree, src)
9
10
11
def test_create_node_dict_for_JsTree_1():
12
    src = 'test_JsTree_data/JsTree_data_1.json'
13
14
    Tree = graph.oval_graph.OvalNode(1, 'operator', 'and', False, None, [
15
        graph.oval_graph.OvalNode(2, 'value', "true", False, None)
16
    ]
17
    )
18
19
    tests.any_test_help.any_test_create_node_dict_for_JsTree(Tree, src)
20
21
22
def test_create_node_dict_for_JsTree_2():
23
    src = 'test_JsTree_data/JsTree_data_2.json'
24
25
    Tree = graph.oval_graph.OvalNode(1, 'operator', 'and', False, None, [
26
        graph.oval_graph.OvalNode(2, 'value', "noteval", False, None)
27
    ]
28
    )
29
30
    tests.any_test_help.any_test_create_node_dict_for_JsTree(Tree, src)
31
32
33
def test_create_node_dict_for_JsTree_3():
34
    src = 'test_JsTree_data/JsTree_data_3.json'
35
36
    Tree = graph.oval_graph.OvalNode(1, 'value', 'false', False, None)
37
38
    tests.any_test_help.any_test_create_node_dict_for_JsTree(Tree, src)
39
40
41
def test_create_node_dict_for_JsTree_4():
42
    src = 'test_JsTree_data/JsTree_data_4.json'
43
44
    Tree = graph.oval_graph.OvalNode(1, 'value', 'true', False, None)
45
46
    tests.any_test_help.any_test_create_node_dict_for_JsTree(Tree, src)
47
48
49
def test_create_node_dict_for_JsTree_5():
50
    src = 'test_JsTree_data/JsTree_data_5.json'
51
52
    Tree = graph.oval_graph.OvalNode(1, 'value', 'error', False, None)
53
54
    tests.any_test_help.any_test_create_node_dict_for_JsTree(Tree, src)
55
56
57
def test_create_node_with_negation_dict_for_JsTree():
58
    src = 'test_JsTree_data/JsTree_data_negated_0.json'
59
60
    Tree = graph.oval_graph.OvalNode(1, 'operator', 'and', True, None, [
61
        graph.oval_graph.OvalNode(2, 'value', "false", False, None)
62
    ]
63
    )
64
65
    tests.any_test_help.any_test_create_node_dict_for_JsTree(Tree, src)
66
67
68
def test_create_node_with_negation_dict_for_JsTree1():
69
    src = 'test_JsTree_data/JsTree_data_negated_1.json'
70
71
    Tree = graph.oval_graph.OvalNode(1, 'operator', 'and', True, None, [
72
        graph.oval_graph.OvalNode(2, 'value', "true", False, None)
73
    ]
74
    )
75
76
    tests.any_test_help.any_test_create_node_dict_for_JsTree(Tree, src)
77
78
79
def test_create_node_with_negation_dict_for_JsTree2():
80
    src = 'test_JsTree_data/JsTree_data_negated_2.json'
81
82
    Tree = graph.oval_graph.OvalNode(1, 'operator', 'and', False, None, [
83
        graph.oval_graph.OvalNode(2, 'value', "true", True, None)
84
    ]
85
    )
86
87
    tests.any_test_help.any_test_create_node_dict_for_JsTree(
88
        Tree.children[0], src)
89
90
91
def test_create_node_with_negation_dict_for_JsTree3():
92
    src = 'test_JsTree_data/JsTree_data_negated_3.json'
93
94
    Tree = graph.oval_graph.OvalNode(1, 'operator', 'and', False, None, [
95
        graph.oval_graph.OvalNode(2, 'value', "false", True, None)
96
    ]
97
    )
98
99
    tests.any_test_help.any_test_create_node_dict_for_JsTree(
100
        Tree.children[0], src)
101
102
103
def test_transformation_tree_to_Json_for_JsTree_0():
104
    test_data_src = 'test_data/JsTree_json0.json'
105
    src = 'data/ssg-fedora-ds-arf.xml'
106
    rule_id = 'xccdf_org.ssgproject.content_rule_accounts_passwords_pam_faillock_deny'
107
108
    tests.any_test_help.any_test_transformation_tree_to_Json_for_JsTree(
109
        src, test_data_src, rule_id)
110
111
112
def test_transformation_tree_to_Json_for_JsTree_with_duplicated_test():
113
    test_data_src = 'test_data/JsTree_json1.json'
114
    src = 'data/ssg-fedora-ds-arf.xml'
115
    rule_id = 'xccdf_org.ssgproject.content_rule_disable_host_auth'
116
117
    tests.any_test_help.any_test_transformation_tree_to_Json_for_JsTree(
118
        src, test_data_src, rule_id)
119