#2404 add missing test and revert some name changes

This commit is contained in:
Cristian-VM2
2024-03-26 12:39:11 +00:00
parent 944b248300
commit 128e2227d6
4 changed files with 16 additions and 3 deletions

View File

@@ -158,7 +158,7 @@ green_ier_blocked: -0.001
# Patching / Reset durations
os_patching_duration: 5 # The time taken to patch the OS
node_reset_duration: 5 # The time taken to reset a node (hardware)
service_fixing_duration: 5 # The time taken to patch a service
service_patching_duration: 5 # The time taken to patch a service
file_system_repairing_limit: 5 # The time take to repair the file system
file_system_restoring_limit: 5 # The time take to restore the file system
file_system_scanning_limit: 5 # The time taken to scan the file system

View File

@@ -5634,7 +5634,7 @@
"green_ier_blocked": -0.001,
"os_patching_duration": 5,
"node_reset_duration": 5,
"service_fixing_duration": 5,
"service_patching_duration": 5,
"file_system_repairing_limit": 5,
"file_system_restoring_limit": 5,
"file_system_scanning_limit": 5

View File

@@ -117,7 +117,7 @@ class Application(IOSoftware):
"""The main application loop."""
pass
def close(self) -> None:
def close(self) -> bool:
"""Close the Application."""
if self.operating_state == ApplicationOperatingState.RUNNING:
self.sys_log.info(f"Closed Application{self.name}")

View File

@@ -111,6 +111,19 @@ def test_query_when_client_is_closed(database_client_on_computer):
assert database_client.query(sql="test") is False
def test_query_fail_to_connect(database_client_on_computer):
"""Database client query should return False if the connect attempt fails."""
database_client, computer = database_client_on_computer
def return_false():
return False
database_client.connect = return_false
database_client.connected = False
assert database_client.query(sql="test") is False
def test_client_receives_response_when_closed(database_client_on_computer):
"""Database client receive should return False when it is closed."""
database_client, computer = database_client_on_computer