Skip to content
This repository was archived by the owner on Aug 5, 2022. It is now read-only.

Commit 576f444

Browse files
committed
xml generation tests: test an error case in the criteria
A criteria cannot have duplicated allowed values. When the user provides such a criterion, the generation should fail. Signed-off-by: David Wagner <[email protected]>
1 parent cccb2c0 commit 576f444

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
InclusiveCriterion Duplicate : Foo Foo

test/xml-generator/test.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,5 +118,14 @@ def test_conflicting(self):
118118
tester = Tester(self.nominal_pfconfig, vector)
119119
tester.check(expectedErrors=1)
120120

121+
def test_fail_criteria(self):
122+
self.nominal_pfconfig.criteria = os.path.join(config_dir, "duplicate_criterion_value.txt")
123+
# Empty test vector: we want to make sure that the erroneous criterion
124+
# is the only source of error
125+
empty_vector = TestVector()
126+
127+
tester = Tester(self.nominal_pfconfig, empty_vector)
128+
tester.check(expectedErrors=1)
129+
121130
if __name__ == "__main__":
122131
unittest.main()

0 commit comments

Comments
 (0)