Skip to content

Commit

Permalink
describe namespace collision
Browse files Browse the repository at this point in the history
  • Loading branch information
khiron committed Apr 1, 2024
1 parent 85b33a5 commit e9b4700
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/test_app/test_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,9 @@ def main(self, data: str) -> str:
assert cogent3.app.apps().names() == ["app1", "app1"]

with pytest.raises(NameError):
app_by_name = get_app("app1")
_ = get_app("app1") # request app by name only, when there are multiple apps with the same name

app_by_module_name_1 = get_app("module1.app1")
app_by_module_name_1 = get_app("module1.app1") # request app by name and module
app_by_module_name_2 = get_app("module2.app1")
assert app_by_module_name_1("Hello") == "HELLO"
assert app_by_module_name_2("Hello") == "hello"
Expand All @@ -151,4 +151,5 @@ def dummy(val: int) -> int:
apps = available_apps()
assert isinstance(apps, Table)
apps.filtered(lambda x: dummy.__name__ == x, columns='name')
assert apps.shape[0] == 1
assert apps.shape[0] == 1

0 comments on commit e9b4700

Please sign in to comment.