mirror of
https://github.com/pyscript/pyscript.git
synced 2025-12-21 19:25:35 -05:00
Improve UX when we can't install a package (#1000)
This commit is contained in:
@@ -101,6 +101,43 @@ class TestBasic(PyScriptTest):
|
||||
"hello asciitree", # printed by us
|
||||
]
|
||||
|
||||
def test_non_existent_package(self):
|
||||
self.pyscript_run(
|
||||
"""
|
||||
<py-config>
|
||||
packages = ["nonexistendright"]
|
||||
</py-config>
|
||||
""",
|
||||
wait_for_pyscript=False,
|
||||
)
|
||||
|
||||
expected_alert_banner_msg = (
|
||||
"(PY1001): Unable to install package(s) 'nonexistendright'. "
|
||||
"Unable to find package in PyPI. Please make sure you have "
|
||||
"entered a correct package name."
|
||||
)
|
||||
|
||||
alert_banner = self.page.wait_for_selector(".alert-banner")
|
||||
assert expected_alert_banner_msg in alert_banner.inner_text()
|
||||
|
||||
def test_no_python_wheel(self):
|
||||
self.pyscript_run(
|
||||
"""
|
||||
<py-config>
|
||||
packages = ["opsdroid"]
|
||||
</py-config>
|
||||
""",
|
||||
wait_for_pyscript=False,
|
||||
)
|
||||
|
||||
expected_alert_banner_msg = (
|
||||
"(PY1001): Unable to install package(s) 'opsdroid'. "
|
||||
"Reason: Can't find a pure Python 3 Wheel for package(s) 'opsdroid'"
|
||||
)
|
||||
|
||||
alert_banner = self.page.wait_for_selector(".alert-banner")
|
||||
assert expected_alert_banner_msg in alert_banner.inner_text()
|
||||
|
||||
def test_dynamically_add_py_script_tag(self):
|
||||
self.pyscript_run(
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user