SIENTIAPDE-1318
Refactor project structure and update configurations - Deleted the empty `__init__.py` file to clean up the project structure. - Renamed the project from "laborious" to "ingestor" in `pyproject.toml`, updating the description accordingly. - Improved type hints and conditional checks in the `Ingestor`, `DataManager`, `IngestorManager`, and `OpcManager` classes for better code clarity and type safety. - Enhanced error handling and assertions in various methods to ensure robustness. - Updated unit tests to reflect changes in class names and error handling improvements.
This commit is contained in:
@@ -127,7 +127,7 @@ async def test_set_security_no_cert(opc_manager):
|
||||
except ValueError as e:
|
||||
assert str(e) == 'Certificate and private key paths must be provided for secure connection.'
|
||||
else:
|
||||
assert False, 'ValueError not raised'
|
||||
raise AssertionError('ValueError not raised')
|
||||
|
||||
assert opc_manager.client.set_security.call_count == 0
|
||||
|
||||
@@ -218,7 +218,7 @@ async def test_create_subscription_no_client(raw_opc_manager):
|
||||
except ValueError as e:
|
||||
assert str(e) == 'Client not connected. Call connect first.'
|
||||
else:
|
||||
assert False, 'ValueError not raised'
|
||||
raise AssertionError('ValueError not raised')
|
||||
|
||||
|
||||
@mark.asyncio
|
||||
@@ -284,7 +284,7 @@ async def test_subscribe_no_subscription(metrics, opc_manager):
|
||||
except ValueError as e:
|
||||
assert str(e) == 'Subscription not created. Call create_subscription first.'
|
||||
else:
|
||||
assert False, 'ValueError not raised'
|
||||
raise AssertionError('ValueError not raised')
|
||||
metrics.OPC_TAGS_SUBSCRIBED.labels.assert_not_called()
|
||||
|
||||
|
||||
@@ -315,7 +315,7 @@ async def test_unsubscribe_no_subscription(opc_manager):
|
||||
async def test_unsubscribe_success(opc_manager_subscribed):
|
||||
await opc_manager_subscribed.unsubscribe('sub1')
|
||||
|
||||
opc_manager_subscribed.subscriptions.get('sub1') is None
|
||||
assert opc_manager_subscribed.subscriptions.get('sub1') is None
|
||||
|
||||
|
||||
@mark.asyncio
|
||||
|
||||
Reference in New Issue
Block a user