Skip to content

Commit

Permalink
for loop, add sanity test for multiple ignoreModelPrefix (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
adrpo authored Mar 29, 2024
1 parent cf7cf34 commit 1f04a82
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions configs/sanityCheck.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
},
{
"library": "MyOtherLibrary",
"ignoreModelPrefix":["MyOtherLibrary.Mechanics.MultiBody.Examples.Pendulum", "Some.Other,NonExistentPath"],
"libraryVersion": "1.0.0",
"loadFileCommands": [
"loadFile(\"sanityCheck/MyOtherLibrary/package.mo\")"
Expand Down
3 changes: 2 additions & 1 deletion test.py
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,8 @@ def hashReferenceFiles(s):
if conf.get("ignoreModelPrefix"):
if isinstance(conf["ignoreModelPrefix"], list):
prefixes = conf["ignoreModelPrefix"]
res=list(filter(lambda x: not x.startswith(prefix), res) for prefix in prefixes)
for prefix in prefixes:
res=list(filter(lambda x: not x.startswith(prefix), res))
else: # in this part it should be only a string
prefix = conf["ignoreModelPrefix"]
res=list(filter(lambda x: not x.startswith(prefix), res))
Expand Down

0 comments on commit 1f04a82

Please sign in to comment.