-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom Object to XML Functionality with Tests #1
base: main
Are you sure you want to change the base?
Conversation
tests/unit/test_ObjectToXML.py
Outdated
self.tree_with_children.children[0].children.append(xml_object(name = 'population.process', attribute_dict = {'id':'SIGNALING', 'version':'complex'}, self_closing = True) ) | ||
|
||
print(self) | ||
print("olaf") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make sure these debug print statements get removed before you send to pull request
tests/unit/test_ObjectToXML.py
Outdated
self.assertEqual(children_elements[0].attrib, {'id':'DIVISION_POTENTIAL', 'value':'3'}) | ||
|
||
self.assertEqual(children_elements[1].tag, 'population.process') | ||
self.assertEqual(children_elements[1].attrib, {'id':'METABOLISM', 'version':'complex'}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there are cleaner ways to do this but we don't need to do that now
tests/unit/test_ObjectToXML.py
Outdated
|
||
current_script_path = os.path.dirname(os.path.abspath(__file__)) | ||
relative_path_to_xml_object = os.path.normpath(os.path.join(current_script_path, '../../src/')) | ||
sys.path.append(relative_path_to_xml_object) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
flag to fix at another point
src/ObjectToXML.py
Outdated
child_element = child.convert_to_element_tree() | ||
element.append(child_element) | ||
return element | ||
def save_XML(self, file_name): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make sure you follow a style guide with spacing the methods
src/ObjectToXML.py
Outdated
from typing import List | ||
|
||
@dataclass(frozen=True, order=True) | ||
class xml_object: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be camel case
…essary components in xml_object.py, uncertain how low level it should operate. Should it receive from gui.py strings or xml_objects.
… remade with PyQt Designer or another GUI designer. Functions required for creating final set up .xml located in xml_object.py and compile_xml.py
Added files: