Skip to content

Commit

Permalink
Merge pull request #9 from Myoldmopar/TestOrdering
Browse files Browse the repository at this point in the history
Add support for reference-class-name
  • Loading branch information
Myoldmopar authored Jan 23, 2018
2 parents a2c3a69 + 20d04e3 commit e34bc29
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pyiddidf/idd/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def __init__(self):
self.field_flags = ["\\field", "\\note", "\\required-field", "\\begin-extensible", "\\unitsBasedOnField",
"\\units", "\\ip-units", "\\scheduleunits", "\\minimum", "\\maximum", "\\default",
"\\deprecated", "\\autosizable", "\\autocalculatable", "\\type", "\\retaincase",
"\\key", "\\object-list", "\\reference", "\\external-list"]
"\\key", "\\object-list", "\\reference-class-name", "\\reference", "\\external-list"]

def process_file_given_file_path(self, file_path):
"""
Expand Down
19 changes: 19 additions & 0 deletions test/idd/test_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,25 @@ def test_repeated_object_meta_idd(self):
version_obj = ret_value.get_object_by_type("version")
self.assertEquals(1, len(version_obj.fields))

def test_new_reference_class_name(self):
idd_object = """
!IDD_Version 0.1.4
!IDD_BUILD abcded0810
\\group Simulation Parameters
NewObject,
A1; \\field Name
\\required-field
\\type alpha
\\reference-class-name validBranchEquipmentTypes
\\reference validBranchEquipmentNames
"""
processor = IDDProcessor()
ret_value = processor.process_file_via_stream(StringIO.StringIO(idd_object))
self.assertEquals(1, len(ret_value.groups))
self.assertEquals(1, len(ret_value.groups[0].objects))
version_obj = ret_value.get_object_by_type("NewObject")
self.assertEquals(1, len(version_obj.fields))

def test_single_line_obj_lookup(self):
idd_object = """
!IDD_Version 1.2.0
Expand Down

0 comments on commit e34bc29

Please sign in to comment.