Skip to content

Commit

Permalink
Re-format.
Browse files Browse the repository at this point in the history
  • Loading branch information
adamghill committed Jan 19, 2024
1 parent dc528cb commit 669a49f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
20 changes: 13 additions & 7 deletions tests/components/test_get_locations.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,7 @@ def test_get_locations_apps_setting_list(settings, cache_clear): # noqa: ARG001
"project",
]

expected = [
("project.components.hello_world", "HelloWorldView"),
("components.hello_world", "HelloWorldView")
]
expected = [("project.components.hello_world", "HelloWorldView"), ("components.hello_world", "HelloWorldView")]
actual = get_locations("hello-world")

assert expected == actual
Expand Down Expand Up @@ -141,14 +138,20 @@ def test_get_locations_installed_app_with_app_config(settings, clear_apps, cache
"example.coffee.apps.Config",
]

expected = [("example.coffee.components.hello_world", "HelloWorldView"), ("components.hello_world", "HelloWorldView")]
expected = [
("example.coffee.components.hello_world", "HelloWorldView"),
("components.hello_world", "HelloWorldView"),
]
actual = get_locations("hello-world")

assert expected == actual

# test when the app is in a subdirectory "apps" with Config
settings.INSTALLED_APPS[0] = "foo_project.apps.bar_app.apps.Config"
expected_location = [("foo_project.apps.bar_app.components.foo_bar", "FooBarView"), ("components.foo_bar", "FooBarView")]
expected_location = [
("foo_project.apps.bar_app.components.foo_bar", "FooBarView"),
("components.foo_bar", "FooBarView"),
]
actual_location = get_locations("foo-bar")
assert expected_location == actual_location

Expand All @@ -158,6 +161,9 @@ def test_get_locations_installed_app_with_apps(settings, clear_apps, cache_clear
settings.INSTALLED_APPS = [
"example.apps.main",
]
expected_location = [("example.apps.main.components.sidebar_menu", "SidebarMenuView"), ("components.sidebar_menu", "SidebarMenuView")]
expected_location = [
("example.apps.main.components.sidebar_menu", "SidebarMenuView"),
("components.sidebar_menu", "SidebarMenuView"),
]
actual_location = get_locations("sidebar-menu")
assert expected_location == actual_location
8 changes: 4 additions & 4 deletions tests/views/message/test_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,10 @@ def test_message_component_class_not_loaded(client):
"unicorn.components.tests.views.fake_components.FakeComponentNotThere",
"FakecomponentnotthereView",
),
(
"components.tests.views.fake_components.FakeComponentNotThere",
"FakecomponentnotthereView",
),
(
"components.tests.views.fake_components.FakeComponentNotThere",
"FakecomponentnotthereView",
),
]
assert e.value.locations == expected_locations

Expand Down

0 comments on commit 669a49f

Please sign in to comment.