Skip to content

Commit

Permalink
Fix typo in local system GUI page resolution with unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
NeonDaniel committed Jul 19, 2023
1 parent baaa5b2 commit 7b8e29b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ovos_gui/page.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ def get_uri(self, framework: str = "qt5", server_url: str = None) -> str:
if isfile(file_path):
return file_path
# Check system resources
file_path = join(dirname(__file__), "res", "gui", framework)
file_path = join(dirname(__file__), "res", "gui", framework,
res_filename)
if isfile(file_path):
return file_path
raise FileNotFoundError(f"Unable to resolve resource file for "
Expand Down
6 changes: 6 additions & 0 deletions test/unittests/test_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ def test_gui_page_from_local_path(self):
qt6 = qt6_page.get_uri("qt6")
self.assertTrue(isfile(qt6))

# System page
system_page = GuiPage(None, "SYSTEM_ImageFrame", False, 30,
"SYSTEM_ImageFrame", namespace, res_dirs)
qt5 = system_page.get_uri("qt5")
self.assertTrue(isfile(qt5))

# Legacy GUI File organization
res_dirs = {"qt5": join(dirname(__file__), "mock_data", "gui", "qt5"),
"qt6": join(dirname(__file__), "mock_data", "gui", "qt6")}
Expand Down

0 comments on commit 7b8e29b

Please sign in to comment.