From c2faea390120bf3104aa877b0fa3195914896469 Mon Sep 17 00:00:00 2001 From: Jack Harper Date: Fri, 6 Dec 2024 11:19:56 +0000 Subject: [PATCH] PEBCAK --- BlockServerToKafka/block_server_monitor.py | 3 +- BlockServerToKafka/kafka_producer.py | 5 ++-- BlockServerToKafka/test_modules/__init__.py | 28 ------------------- .../test_modules/test_block_server_monitor.py | 3 +- .../test_modules/test_forwarder_config.py | 3 +- 5 files changed, 9 insertions(+), 33 deletions(-) delete mode 100644 BlockServerToKafka/test_modules/__init__.py diff --git a/BlockServerToKafka/block_server_monitor.py b/BlockServerToKafka/block_server_monitor.py index a5672a8c..53bb9c69 100644 --- a/BlockServerToKafka/block_server_monitor.py +++ b/BlockServerToKafka/block_server_monitor.py @@ -18,9 +18,10 @@ from typing import Any import ca +from CaChannel import CaChannel, CaChannelException + from BlockServer.core.macros import BLOCK_PREFIX from BlockServerToKafka.kafka_producer import ProducerWrapper -from CaChannel import CaChannel, CaChannelException from server_common.utilities import dehex_and_decompress, print_and_log diff --git a/BlockServerToKafka/kafka_producer.py b/BlockServerToKafka/kafka_producer.py index a10233fc..76710ed4 100644 --- a/BlockServerToKafka/kafka_producer.py +++ b/BlockServerToKafka/kafka_producer.py @@ -16,13 +16,14 @@ from time import sleep from typing import List -from BlockServerToKafka.forwarder_config import ForwarderConfig from kafka import KafkaConsumer, KafkaProducer, errors -from server_common.utilities import print_and_log from streaming_data_types.fbschemas.forwarder_config_update_fc00.Protocol import ( Protocol, ) +from BlockServerToKafka.forwarder_config import ForwarderConfig +from server_common.utilities import print_and_log + class ProducerWrapper: """ diff --git a/BlockServerToKafka/test_modules/__init__.py b/BlockServerToKafka/test_modules/__init__.py deleted file mode 100644 index 882b923b..00000000 --- a/BlockServerToKafka/test_modules/__init__.py +++ /dev/null @@ -1,28 +0,0 @@ -from __future__ import absolute_import, division, print_function, unicode_literals - -# This file is part of the ISIS IBEX application. -# Copyright (C) 2012-2020 Science & Technology Facilities Council. -# All rights reserved. -# -# This program is distributed in the hope that it will be useful. -# This program and the accompanying materials are made available under the -# terms of the Eclipse Public License v1.0 which accompanies this distribution. -# EXCEPT AS EXPRESSLY SET FORTH IN THE ECLIPSE PUBLIC LICENSE V1.0, THE PROGRAM -# AND ACCOMPANYING MATERIALS ARE PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES -# OR CONDITIONS OF ANY KIND. See the Eclipse Public License v1.0 for more details. -# -# You should have received a copy of the Eclipse Public License v1.0 -# along with this program; if not, you can obtain a copy from -# https://www.eclipse.org/org/documents/epl-v10.php or -# http://opensource.org/licenses/eclipse-1.0.php -import os - - -def load_tests(loader, standard_tests, pattern): - """ - This function is needed by the load_tests protocol described at - https://docs.python.org/3/library/unittest.html#load-tests-protocol - The tests in this module are only added under Python 3. - """ - standard_tests.addTests(loader.discover(os.path.dirname(__file__), pattern=pattern)) - return standard_tests diff --git a/BlockServerToKafka/test_modules/test_block_server_monitor.py b/BlockServerToKafka/test_modules/test_block_server_monitor.py index c1155673..6adb57c0 100644 --- a/BlockServerToKafka/test_modules/test_block_server_monitor.py +++ b/BlockServerToKafka/test_modules/test_block_server_monitor.py @@ -16,9 +16,10 @@ import unittest -from BlockServerToKafka.block_server_monitor import BlockServerMonitor from mock import MagicMock, patch +from BlockServerToKafka.block_server_monitor import BlockServerMonitor + class TestBlockServerMonitor(unittest.TestCase): test_address = "TEST_ADDRESS" diff --git a/BlockServerToKafka/test_modules/test_forwarder_config.py b/BlockServerToKafka/test_modules/test_forwarder_config.py index 949fec12..920576c6 100644 --- a/BlockServerToKafka/test_modules/test_forwarder_config.py +++ b/BlockServerToKafka/test_modules/test_forwarder_config.py @@ -15,7 +15,6 @@ # http://opensource.org/licenses/eclipse-1.0.php import unittest -from BlockServerToKafka.forwarder_config import ForwarderConfig from streaming_data_types.fbschemas.forwarder_config_update_fc00.Protocol import ( Protocol, ) @@ -24,6 +23,8 @@ ) from streaming_data_types.forwarder_config_update_fc00 import deserialise_fc00 +from BlockServerToKafka.forwarder_config import ForwarderConfig + class TestForwarderConfig(unittest.TestCase): test_schema = "schema"