Skip to content

Pset Templates tests#1772

Merged
Gorgious56 merged 2 commits intoIfcOpenShell:v0.7.0from
Gorgious56:pset_template_tests
Oct 9, 2021
Merged

Pset Templates tests#1772
Gorgious56 merged 2 commits intoIfcOpenShell:v0.7.0from
Gorgious56:pset_template_tests

Conversation

@Gorgious56
Copy link
Copy Markdown
Contributor

Adding feature scenarios for pset and property templates.
In summary :

  • Didn't find how to test the undo / redo functionality since it seems it's disabled in the test configuration
  • Added a sentence to load the default pset templates file
  • Didn't find a way to get a property template id from the ifc file, so I hardcoded it to 2. I tried {ifc}.by_type('IfcSimplePropertyTemplate')[0].id() but that wasn't it.

I also added an if statement before purging the file to prevent info message saying there is no object to purge cluttering console if the default file contains no object.

@Moult
Copy link
Copy Markdown
Contributor

Moult commented Oct 8, 2021

So sorry I missed this. Yes indeed undo redo probably cannot be tested generically across everything. The reason {ifc}.by_type... didn't work is because {ifc} returns the active IFC file, which is not the same as the active external pset template file. It's OK to hardcode it as 2 in this simple scenario. In the future, if the tests get more complex, we can introduce a new variable like {pset_ifc} which refers to that external file. Feel free to merge :)

@Gorgious56 Gorgious56 merged commit e455f87 into IfcOpenShell:v0.7.0 Oct 9, 2021
@Gorgious56
Copy link
Copy Markdown
Contributor Author

@Moult No problem that gave me the time to reflect on the changes. Thanks for the explanations !

@Gorgious56 Gorgious56 deleted the pset_template_tests branch October 9, 2021 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants