mirror of
https://github.com/akuker/RASCSI.git
synced 2026-04-21 18:17:07 +00:00
Get and set pretty hostname to use as system name in Web UI (#997)
- Display the pretty hostname as system name in header - Move IP and hostname down to the footer - New endpoint for setting the pretty hostname, plus form field in the Web UI - (unrelated) Use platform.uname() instead of shell uname - (unrelated) Better logic for fetching the Mac HD Drivers zip file in easyinstall.sh
This commit is contained in:
@@ -196,3 +196,49 @@ def test_set_theme_via_query_string(http_client, theme):
|
||||
assert response.status_code == 200
|
||||
assert response_data["status"] == STATUS_SUCCESS
|
||||
assert response_data["messages"][0]["message"] == f"Theme changed to '{theme}'."
|
||||
|
||||
|
||||
# route("/sys/rename", methods=["POST"])
|
||||
def test_rename_system(env, http_client):
|
||||
new_name = "SYSTEM NAME TEST"
|
||||
|
||||
response = http_client.get("/env")
|
||||
response_data = response.json()
|
||||
|
||||
old_name = response_data["data"]["system_name"]
|
||||
|
||||
response = http_client.post(
|
||||
"/sys/rename",
|
||||
data={
|
||||
"system_name": new_name,
|
||||
},
|
||||
)
|
||||
|
||||
response_data = response.json()
|
||||
|
||||
assert response.status_code == 200
|
||||
assert response_data["status"] == STATUS_SUCCESS
|
||||
assert response_data["messages"][0]["message"] == f"System name changed to '{new_name}'."
|
||||
|
||||
response = http_client.get("/env")
|
||||
response_data = response.json()
|
||||
|
||||
assert response_data["data"]["system_name"] == new_name
|
||||
|
||||
response = http_client.post(
|
||||
"/sys/rename",
|
||||
data={
|
||||
"system_name": old_name,
|
||||
},
|
||||
)
|
||||
|
||||
response_data = response.json()
|
||||
|
||||
assert response.status_code == 200
|
||||
assert response_data["status"] == STATUS_SUCCESS
|
||||
assert response_data["messages"][0]["message"] == f"System name changed to '{old_name}'."
|
||||
|
||||
response = http_client.get("/env")
|
||||
response_data = response.json()
|
||||
|
||||
assert response_data["data"]["system_name"] == old_name
|
||||
|
||||
Reference in New Issue
Block a user