Loading .gitignore +3 −0 Original line number Diff line number Diff line Loading @@ -82,6 +82,9 @@ target/ profile_default/ ipython_config.py # PyCharm .idea/ # pyenv # For a library or package, you might want to ignore these files since the code is # intended to run in multiple environments; otherwise, check them in: Loading src/monitoring/tests/test_monitoring.py +33 −2 Original line number Diff line number Diff line Loading @@ -11,6 +11,7 @@ SERVER_ADDRESS = '127.0.0.1' LISTEN_ADDRESS = '[::]' PORT = 7070 # This fixture will be requested by test cases and last during testing session @pytest.fixture(scope='session') def monitoring_service(): Loading @@ -26,6 +27,7 @@ def monitoring_service(): LOGGER.info('Terminating MonitoringService...') stop_server(server) # This fixture will be requested by test cases and last during testing session. # The client requires the server, so client fixture has the server as dependency. @pytest.fixture(scope='session') Loading @@ -35,6 +37,7 @@ def monitoring_client(monitoring_service): LOGGER.warning('monitoring_client returning') return client # Test case that makes use of client fixture to test server's IncludeKpi method def test_include_kpi(monitoring_client): LOGGER.warning('test_include_kpi begin') Loading @@ -49,5 +52,33 @@ def test_include_kpi(monitoring_client): LOGGER.debug(str(response)) assert isinstance(response, context_pb2.Empty) # You can add as many tests as you want. Just copy the "def test_include_kpi(monitoring_client):" and implement # appropriate tests. monitoring_client and monitoring_service fixtures and their connection are reused along tests. # Test case that makes use of client fixture to test server's MonitorKpi method def test_monitor_kpi(monitoring_client): LOGGER.warning('test_monitor_kpi begin') # form request kpi = monitoring_pb2.Kpi() # TBC # Test case that makes use of client fixture to test server's GetStreamKpi method def test_getstream_kpi(monitoring_client): LOGGER.warning('test_getstream_kpi begin') # form request kpi = monitoring_pb2.Kpi() # TBC # Test case that makes use of client fixture to test server's GetInstantKpi method def test_getinstant_kpi(monitoring_client): LOGGER.warning('test_getinstant_kpi begin') # form request kpi = monitoring_pb2.Kpi() # TBC No newline at end of file Loading
.gitignore +3 −0 Original line number Diff line number Diff line Loading @@ -82,6 +82,9 @@ target/ profile_default/ ipython_config.py # PyCharm .idea/ # pyenv # For a library or package, you might want to ignore these files since the code is # intended to run in multiple environments; otherwise, check them in: Loading
src/monitoring/tests/test_monitoring.py +33 −2 Original line number Diff line number Diff line Loading @@ -11,6 +11,7 @@ SERVER_ADDRESS = '127.0.0.1' LISTEN_ADDRESS = '[::]' PORT = 7070 # This fixture will be requested by test cases and last during testing session @pytest.fixture(scope='session') def monitoring_service(): Loading @@ -26,6 +27,7 @@ def monitoring_service(): LOGGER.info('Terminating MonitoringService...') stop_server(server) # This fixture will be requested by test cases and last during testing session. # The client requires the server, so client fixture has the server as dependency. @pytest.fixture(scope='session') Loading @@ -35,6 +37,7 @@ def monitoring_client(monitoring_service): LOGGER.warning('monitoring_client returning') return client # Test case that makes use of client fixture to test server's IncludeKpi method def test_include_kpi(monitoring_client): LOGGER.warning('test_include_kpi begin') Loading @@ -49,5 +52,33 @@ def test_include_kpi(monitoring_client): LOGGER.debug(str(response)) assert isinstance(response, context_pb2.Empty) # You can add as many tests as you want. Just copy the "def test_include_kpi(monitoring_client):" and implement # appropriate tests. monitoring_client and monitoring_service fixtures and their connection are reused along tests. # Test case that makes use of client fixture to test server's MonitorKpi method def test_monitor_kpi(monitoring_client): LOGGER.warning('test_monitor_kpi begin') # form request kpi = monitoring_pb2.Kpi() # TBC # Test case that makes use of client fixture to test server's GetStreamKpi method def test_getstream_kpi(monitoring_client): LOGGER.warning('test_getstream_kpi begin') # form request kpi = monitoring_pb2.Kpi() # TBC # Test case that makes use of client fixture to test server's GetInstantKpi method def test_getinstant_kpi(monitoring_client): LOGGER.warning('test_getinstant_kpi begin') # form request kpi = monitoring_pb2.Kpi() # TBC No newline at end of file