Skip to content

Commit

Permalink
fix spec parsing test for tot default
Browse files Browse the repository at this point in the history
  • Loading branch information
cecille committed Jul 30, 2024
1 parent 702f478 commit 5bfe65b
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/python_testing/TestSpecParsingSupport.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,20 +235,17 @@ def setup_class(self):
def test_build_xml_override(self):
# checks that the 1.3 spec (default) does not contain in-progress clusters and the TOT does
tot_xml_clusters, problems = build_xml_clusters(PrebuiltDataModelDirectory.kMaster)
asserts.assert_greater(len(set(tot_xml_clusters.keys()) - set(self.spec_xml_clusters.keys())),
one_three_clusters, problems = build_xml_clusters(PrebuiltDataModelDirectory.k1_3)
asserts.assert_greater(len(set(tot_xml_clusters.keys()) - set(one_three_clusters.keys())),
0, "In progress dir does not contain any clusters not in 1.3")
# only the pulse width modulation cluster was removed post 1.3
asserts.assert_equal(set(self.spec_xml_clusters.keys()) - set(tot_xml_clusters.keys()),
asserts.assert_equal(set(one_three_clusters.keys()) - set(tot_xml_clusters.keys()),
set([Clusters.PulseWidthModulation.id]), "There are some 1.3 clusters that are not included in the TOT spec")

str_path = str(os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', '..', 'data_model', '1.3', 'clusters'))
str_path = str(os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', '..', 'data_model', 'master', 'clusters'))
string_override_check, problems = build_xml_clusters(str_path)
asserts.assert_equal(string_override_check.keys(), self.spec_xml_clusters.keys(), "Mismatched cluster generation")

path = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', '..', 'data_model', '1.3', 'clusters')
path_override_check, problems = build_xml_clusters(path)
asserts.assert_equal(path_override_check.keys(), self.spec_xml_clusters.keys(), "Mismatched cluster generation")

with asserts.assert_raises(SpecParsingException):
build_xml_clusters("baddir")

Expand Down

0 comments on commit 5bfe65b

Please sign in to comment.