diff --git a/src/webui/service/device/routes.py b/src/webui/service/device/routes.py index 1bb5d26fcc35698206764946a8922678438cdeea..f1423e92ed63fa778448978167c1c8e646414885 100644 --- a/src/webui/service/device/routes.py +++ b/src/webui/service/device/routes.py @@ -125,8 +125,8 @@ def delete(device_uuid): response = device_client.DeleteDevice(request) device_client.close() - flash('Device "{:s}" deleted successfully!'.format(device_uuid), 'success') + flash(f'Device "{device_uuid}" deleted successfully!', 'success') except Exception as e: - flash('Problem deleting device "{:s}": {:s}'.format(device_uuid, str(e.details())), 'danger') + flash(f'Problem deleting device "{device_uuid}": {e.details()}', 'danger') current_app.logger.exception(e) return redirect(url_for('device.home')) diff --git a/src/webui/tests/test_unitary.py b/src/webui/tests/test_unitary.py index e1afe79e61b19b4ca5a846e1ecb9df90e5ce4099..3062d81746a8de2a37ea1e489b07b98ddebb792b 100644 --- a/src/webui/tests/test_unitary.py +++ b/src/webui/tests/test_unitary.py @@ -59,7 +59,7 @@ class TestWebUI(ClientTestCase): mock.patch.stopall() return super().tearDown(client) - def test_routes(self, client): + def test_routes(self, _) -> None: with self.app.app_context(): url_for('main.home') url_for('service.home') @@ -70,7 +70,7 @@ class TestWebUI(ClientTestCase): url_for('js.topology_js') url_for('js.site_js') - def test_device_add_action_success(self, client): + def test_device_add_action_success(self, client) -> None: with client.session_transaction() as sess: sess['context_uuid'] = 'admin' DEVICE_EMU = { @@ -96,11 +96,9 @@ class TestWebUI(ClientTestCase): def test_service_up(self, client): pass - - -# def test_service_up(client): -# rw = client.get('/') -# assert rw.status_code == 200, 'Service is not up!' + def test_service_up(client): + rw = client.get('/') + assert rw.status_code == 200, 'Service is not up!' # def test_home_page(client): # rw = client.get('/')