Passed
Pull Request — master (#161)
by Jan
04:20
created

tests.test_JsTree   A

Complexity

Total Complexity 12

Size/Duplication

Total Lines 182
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 118
dl 0
loc 182
rs 10
c 0
b 0
f 0
wmc 12

12 Functions

Rating   Name   Duplication   Size   Complexity  
A test_transformation_tree_to_Json_for_JsTree_0() 0 7 1
A test_create_node_dict_for_JsTree_0() 0 4 1
A test_create_node_dict_for_JsTree_5() 0 10 1
A test_transformation_tree_to_Json_for_JsTree_with_duplicated_test() 0 7 1
A test_create_node_dict_for_JsTree_2() 0 17 1
A test_create_node_with_negation_dict_for_JsTree1() 0 18 1
A test_create_node_with_negation_dict_for_JsTree() 0 18 1
A test_create_node_dict_for_JsTree_3() 0 9 1
A test_create_node_dict_for_JsTree_4() 0 10 1
A test_create_node_with_negation_dict_for_JsTree2() 0 19 1
A test_create_node_with_negation_dict_for_JsTree3() 0 19 1
A test_create_node_dict_for_JsTree_1() 0 17 1
1
import tests.any_test_help
0 ignored issues
show
Coding Style Naming introduced by
Module name "test_JsTree" doesn't conform to '(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$' pattern ('(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$' pattern)

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
introduced by
Missing module docstring
Loading history...
introduced by
import missing from __future__ import absolute_import
Loading history...
2
from oval_graph.oval_node import OvalNode
3
4
5
def test_create_node_dict_for_JsTree_0():
0 ignored issues
show
Coding Style Naming introduced by
Function name "test_create_node_dict_for_JsTree_0" doesn't conform to '[a-z_][a-z0-9_]2,30$' pattern ('[a-z_][a-z0-9_]2,30$' pattern)

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
introduced by
Missing function or method docstring
Loading history...
6
    src = 'test_data/test_JsTree_data/JsTree_data_0.json'
0 ignored issues
show
Coding Style introduced by
Bad indentation. Found 4 tabs, expected 1
Loading history...
7
    tree = tests.any_test_help.get_simple_tree()
0 ignored issues
show
Coding Style introduced by
Bad indentation. Found 4 tabs, expected 1
Loading history...
8
    tests.any_test_help.any_test_create_node_dict_for_JsTree(tree, src)
0 ignored issues
show
Coding Style introduced by
Bad indentation. Found 4 tabs, expected 1
Loading history...
9
10
11
def test_create_node_dict_for_JsTree_1():
0 ignored issues
show
Coding Style Naming introduced by
Function name "test_create_node_dict_for_JsTree_1" doesn't conform to '[a-z_][a-z0-9_]2,30$' pattern ('[a-z_][a-z0-9_]2,30$' pattern)

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
introduced by
Missing function or method docstring
Loading history...
12
    src = 'test_data/test_JsTree_data/JsTree_data_1.json'
0 ignored issues
show
Coding Style introduced by
Bad indentation. Found 4 tabs, expected 1
Loading history...
13
14
    tree = OvalNode(
0 ignored issues
show
Coding Style introduced by
Bad indentation. Found 4 tabs, expected 1
Loading history...
15
        node_id=1,
16
        node_type='operator',
17
        value='and',
18
        children=[
19
            OvalNode(
20
                node_id=2,
21
                node_type='value',
22
                value='true',
23
            )
24
        ]
25
    )
26
27
    tests.any_test_help.any_test_create_node_dict_for_JsTree(tree, src)
0 ignored issues
show
Coding Style introduced by
Bad indentation. Found 4 tabs, expected 1
Loading history...
28
29
30
def test_create_node_dict_for_JsTree_2():
0 ignored issues
show
Coding Style Naming introduced by
Function name "test_create_node_dict_for_JsTree_2" doesn't conform to '[a-z_][a-z0-9_]2,30$' pattern ('[a-z_][a-z0-9_]2,30$' pattern)

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
introduced by
Missing function or method docstring
Loading history...
31
    src = 'test_data/test_JsTree_data/JsTree_data_2.json'
0 ignored issues
show
Coding Style introduced by
Bad indentation. Found 4 tabs, expected 1
Loading history...
32
33
    tree = OvalNode(
0 ignored issues
show
Coding Style introduced by
Bad indentation. Found 4 tabs, expected 1
Loading history...
34
        node_id=1,
35
        node_type='operator',
36
        value='and',
37
        children=[
38
            OvalNode(
39
                node_id=2,
40
                node_type='value',
41
                value='noteval',
42
            )
43
        ]
44
    )
45
46
    tests.any_test_help.any_test_create_node_dict_for_JsTree(tree, src)
0 ignored issues
show
Coding Style introduced by
Bad indentation. Found 4 tabs, expected 1
Loading history...
47
48
49
def test_create_node_dict_for_JsTree_3():
0 ignored issues
show
Coding Style Naming introduced by
Function name "test_create_node_dict_for_JsTree_3" doesn't conform to '[a-z_][a-z0-9_]2,30$' pattern ('[a-z_][a-z0-9_]2,30$' pattern)

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
introduced by
Missing function or method docstring
Loading history...
50
    src = 'test_data/test_JsTree_data/JsTree_data_3.json'
0 ignored issues
show
Coding Style introduced by
Bad indentation. Found 4 tabs, expected 1
Loading history...
51
52
    tree = OvalNode(
0 ignored issues
show
Coding Style introduced by
Bad indentation. Found 4 tabs, expected 1
Loading history...
53
        node_id=1,
54
        node_type='value',
55
        value='false',
56
    )
57
    tests.any_test_help.any_test_create_node_dict_for_JsTree(tree, src)
0 ignored issues
show
Coding Style introduced by
Bad indentation. Found 4 tabs, expected 1
Loading history...
58
59
60
def test_create_node_dict_for_JsTree_4():
0 ignored issues
show
Coding Style Naming introduced by
Function name "test_create_node_dict_for_JsTree_4" doesn't conform to '[a-z_][a-z0-9_]2,30$' pattern ('[a-z_][a-z0-9_]2,30$' pattern)

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
introduced by
Missing function or method docstring
Loading history...
61
    src = 'test_data/test_JsTree_data/JsTree_data_4.json'
0 ignored issues
show
Coding Style introduced by
Bad indentation. Found 4 tabs, expected 1
Loading history...
62
63
    tree = OvalNode(
0 ignored issues
show
Coding Style introduced by
Bad indentation. Found 4 tabs, expected 1
Loading history...
64
        node_id=1,
65
        node_type='value',
66
        value='true',
67
    )
68
69
    tests.any_test_help.any_test_create_node_dict_for_JsTree(tree, src)
0 ignored issues
show
Coding Style introduced by
Bad indentation. Found 4 tabs, expected 1
Loading history...
70
71
72
def test_create_node_dict_for_JsTree_5():
0 ignored issues
show
Coding Style Naming introduced by
Function name "test_create_node_dict_for_JsTree_5" doesn't conform to '[a-z_][a-z0-9_]2,30$' pattern ('[a-z_][a-z0-9_]2,30$' pattern)

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
introduced by
Missing function or method docstring
Loading history...
73
    src = 'test_data/test_JsTree_data/JsTree_data_5.json'
0 ignored issues
show
Coding Style introduced by
Bad indentation. Found 4 tabs, expected 1
Loading history...
74
75
    tree = OvalNode(
0 ignored issues
show
Coding Style introduced by
Bad indentation. Found 4 tabs, expected 1
Loading history...
76
        node_id=1,
77
        node_type='value',
78
        value='error',
79
    )
80
81
    tests.any_test_help.any_test_create_node_dict_for_JsTree(tree, src)
0 ignored issues
show
Coding Style introduced by
Bad indentation. Found 4 tabs, expected 1
Loading history...
82
83
84
def test_create_node_with_negation_dict_for_JsTree():
0 ignored issues
show
Coding Style Naming introduced by
Function name "test_create_node_with_negation_dict_for_JsTree" doesn't conform to '[a-z_][a-z0-9_]2,30$' pattern ('[a-z_][a-z0-9_]2,30$' pattern)

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
introduced by
Missing function or method docstring
Loading history...
85
    src = 'test_data/test_JsTree_data/JsTree_data_negated_0.json'
0 ignored issues
show
Coding Style introduced by
Bad indentation. Found 4 tabs, expected 1
Loading history...
86
87
    tree = OvalNode(
0 ignored issues
show
Coding Style introduced by
Bad indentation. Found 4 tabs, expected 1
Loading history...
88
        node_id=1,
89
        node_type='operator',
90
        value='and',
91
        negation=True,
92
        children=[
93
            OvalNode(
94
                node_id=2,
95
                node_type='value',
96
                value='false',
97
            )
98
        ]
99
    )
100
101
    tests.any_test_help.any_test_create_node_dict_for_JsTree(tree, src)
0 ignored issues
show
Coding Style introduced by
Bad indentation. Found 4 tabs, expected 1
Loading history...
102
103
104
def test_create_node_with_negation_dict_for_JsTree1():
0 ignored issues
show
Coding Style Naming introduced by
Function name "test_create_node_with_negation_dict_for_JsTree1" doesn't conform to '[a-z_][a-z0-9_]2,30$' pattern ('[a-z_][a-z0-9_]2,30$' pattern)

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
introduced by
Missing function or method docstring
Loading history...
105
    src = 'test_data/test_JsTree_data/JsTree_data_negated_1.json'
0 ignored issues
show
Coding Style introduced by
Bad indentation. Found 4 tabs, expected 1
Loading history...
106
107
    tree = OvalNode(
0 ignored issues
show
Coding Style introduced by
Bad indentation. Found 4 tabs, expected 1
Loading history...
108
        node_id=1,
109
        node_type='operator',
110
        value='and',
111
        negation=True,
112
        children=[
113
            OvalNode(
114
                node_id=2,
115
                node_type='value',
116
                value='true',
117
            )
118
        ]
119
    )
120
121
    tests.any_test_help.any_test_create_node_dict_for_JsTree(tree, src)
0 ignored issues
show
Coding Style introduced by
Bad indentation. Found 4 tabs, expected 1
Loading history...
122
123
124
def test_create_node_with_negation_dict_for_JsTree2():
0 ignored issues
show
Coding Style Naming introduced by
Function name "test_create_node_with_negation_dict_for_JsTree2" doesn't conform to '[a-z_][a-z0-9_]2,30$' pattern ('[a-z_][a-z0-9_]2,30$' pattern)

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
introduced by
Missing function or method docstring
Loading history...
125
    src = 'test_data/test_JsTree_data/JsTree_data_negated_2.json'
0 ignored issues
show
Coding Style introduced by
Bad indentation. Found 4 tabs, expected 1
Loading history...
126
127
    tree = OvalNode(
0 ignored issues
show
Coding Style introduced by
Bad indentation. Found 4 tabs, expected 1
Loading history...
128
        node_id=1,
129
        node_type='operator',
130
        value='and',
131
        children=[
132
            OvalNode(
133
                node_id=2,
134
                node_type='value',
135
                value='true',
136
                negation=True,
137
            )
138
        ]
139
    )
140
141
    tests.any_test_help.any_test_create_node_dict_for_JsTree(
0 ignored issues
show
Coding Style introduced by
Bad indentation. Found 4 tabs, expected 1
Loading history...
142
        tree.children[0], src)
143
144
145
def test_create_node_with_negation_dict_for_JsTree3():
0 ignored issues
show
Coding Style Naming introduced by
Function name "test_create_node_with_negation_dict_for_JsTree3" doesn't conform to '[a-z_][a-z0-9_]2,30$' pattern ('[a-z_][a-z0-9_]2,30$' pattern)

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
introduced by
Missing function or method docstring
Loading history...
146
    src = 'test_data/test_JsTree_data/JsTree_data_negated_3.json'
0 ignored issues
show
Coding Style introduced by
Bad indentation. Found 4 tabs, expected 1
Loading history...
147
148
    tree = OvalNode(
0 ignored issues
show
Coding Style introduced by
Bad indentation. Found 4 tabs, expected 1
Loading history...
149
        node_id=1,
150
        node_type='operator',
151
        value='and',
152
        children=[
153
            OvalNode(
154
                node_id=2,
155
                node_type='value',
156
                value='false',
157
                negation=True,
158
            )
159
        ]
160
    )
161
162
    tests.any_test_help.any_test_create_node_dict_for_JsTree(
0 ignored issues
show
Coding Style introduced by
Bad indentation. Found 4 tabs, expected 1
Loading history...
163
        tree.children[0], src)
164
165
166
def test_transformation_tree_to_Json_for_JsTree_0():
0 ignored issues
show
Coding Style Naming introduced by
Function name "test_transformation_tree_to_Json_for_JsTree_0" doesn't conform to '[a-z_][a-z0-9_]2,30$' pattern ('[a-z_][a-z0-9_]2,30$' pattern)

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
introduced by
Missing function or method docstring
Loading history...
167
    test_data_src = 'test_data/JsTree_json0.json'
0 ignored issues
show
Coding Style introduced by
Bad indentation. Found 4 tabs, expected 1
Loading history...
168
    src = 'test_data/ssg-fedora-ds-arf.xml'
0 ignored issues
show
Coding Style introduced by
Bad indentation. Found 4 tabs, expected 1
Loading history...
169
    rule_id = 'xccdf_org.ssgproject.content_rule_accounts_passwords_pam_faillock_deny'
0 ignored issues
show
Coding Style introduced by
This line is too long as per the coding-style (86/80).

This check looks for lines that are too long. You can specify the maximum line length.

Loading history...
Coding Style introduced by
Bad indentation. Found 4 tabs, expected 1
Loading history...
170
171
    tests.any_test_help.any_test_transformation_tree_to_Json_for_JsTree(
0 ignored issues
show
Coding Style introduced by
Bad indentation. Found 4 tabs, expected 1
Loading history...
172
        src, test_data_src, rule_id)
173
174
175
def test_transformation_tree_to_Json_for_JsTree_with_duplicated_test():
0 ignored issues
show
Coding Style Naming introduced by
Function name "test_transformation_tree_to_Json_for_JsTree_with_duplicated_test" doesn't conform to '[a-z_][a-z0-9_]2,30$' pattern ('[a-z_][a-z0-9_]2,30$' pattern)

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
introduced by
Missing function or method docstring
Loading history...
176
    test_data_src = 'test_data/JsTree_json1.json'
0 ignored issues
show
Coding Style introduced by
Bad indentation. Found 4 tabs, expected 1
Loading history...
177
    src = 'test_data/ssg-fedora-ds-arf.xml'
0 ignored issues
show
Coding Style introduced by
Bad indentation. Found 4 tabs, expected 1
Loading history...
178
    rule_id = 'xccdf_org.ssgproject.content_rule_disable_host_auth'
0 ignored issues
show
Coding Style introduced by
Bad indentation. Found 4 tabs, expected 1
Loading history...
179
180
    tests.any_test_help.any_test_transformation_tree_to_Json_for_JsTree(
0 ignored issues
show
Coding Style introduced by
Bad indentation. Found 4 tabs, expected 1
Loading history...
181
        src, test_data_src, rule_id)
182