fix: typo and reordered

This commit is contained in:
Florian Roth
2020-07-13 18:22:47 +02:00
parent 758f5039b5
commit 91c0bea570
+5 -5
View File
@@ -476,12 +476,12 @@ class TestRules(unittest.TestCase):
faulty_rules = []
for file in self.yield_next_rule_file_path(self.path_to_rules):
references = self.get_rule_part(file_path=file, part_name="references")
if not references:
print(Fore.YELLOW + "Rule {} has no field 'references'.".format(file))
#faulty_rules.append(file)
elif not isinstance(references, list):
print(Fore.YELLOW + "Rule {} has a refences field that isn't a list.".format(file))
if not isinstance(references, list):
print(Fore.YELLOW + "Rule {} has a references field that isn't a list.".format(file))
faulty_rules.append(file)
#if not references:
#print(Fore.YELLOW + "Rule {} has no field 'references'.".format(file))
#faulty_rules.append(file)
self.assertEqual(faulty_rules, [], Fore.RED +
"There are rules with malformed 'references' fields. (has to be a list of values even if it contains only a single value)")