From 70cc4c38183a37846f6cebc062de790ae1d38ee8 Mon Sep 17 00:00:00 2001 From: Martin Mihaylov <3739458+martomi@users.noreply.github.com> Date: Sun, 4 Apr 2021 21:30:55 +0200 Subject: [PATCH] Formatting: Apply consistent formatting with black --- main.py | 27 +++---- pyproject.toml | 2 + src/chia_log/handlers/__init__.py | 3 +- .../handlers/harvester_activity_handler.py | 44 ++++------- src/chia_log/log_consumer.py | 3 +- src/chia_log/log_handler.py | 4 +- .../parsers/harvester_activity_parser.py | 27 ++++--- src/config.py | 2 +- src/notifier/keep_alive_monitor.py | 32 ++++---- src/notifier/notify_manager.py | 4 +- src/notifier/pushover_notifier.py | 26 ++++--- .../test_harvester_activity_handler.py | 19 +++-- .../parsers/test_harvester_activity_parser.py | 18 +++-- tests/notifier/test_keep_alive_monitor.py | 11 +-- tests/notifier/test_pushover_notifier.py | 73 ++++++++++--------- tests/test_config.py | 6 +- 16 files changed, 144 insertions(+), 157 deletions(-) create mode 100644 pyproject.toml diff --git a/main.py b/main.py index 5719f56..6fb4868 100644 --- a/main.py +++ b/main.py @@ -13,9 +13,10 @@ def parse_arguments(): - parser = argparse.ArgumentParser(description='ChiaFarmWatch: Watch your crops ' - 'with a piece in mind for the yield.') - parser.add_argument('--config', required=True, type=str, help='path to config.yaml') + parser = argparse.ArgumentParser( + description="ChiaFarmWatch: Watch your crops " "with a piece in mind for the yield." + ) + parser.add_argument("--config", required=True, type=str, help="path to config.yaml") return parser.parse_args() @@ -35,14 +36,16 @@ def get_log_level(log_level: str) -> int: return logging.INFO -if __name__ == '__main__': +if __name__ == "__main__": # Parse config and configure logger args = parse_arguments() config = Config(Path(args.config)) log_level = get_log_level(config.get_log_level_config()) logging.basicConfig( - format='[%(asctime)s] [%(levelname)8s] --- %(message)s (%(filename)s:%(lineno)s)', - level=log_level, datefmt='%Y-%m-%d %H:%M:%S') + format="[%(asctime)s] [%(levelname)8s] --- %(message)s (%(filename)s:%(lineno)s)", + level=log_level, + datefmt="%Y-%m-%d %H:%M:%S", + ) # Using file log consumer by default TODO: make configurable chia_logs_config = config.get_chia_logs_config() @@ -56,18 +59,11 @@ def get_log_level(log_level: str) -> int: keep_alive_monitor = KeepAliveMonitor() # Notify manager is responsible for the lifecycle of all notifiers - notify_manager = NotifyManager( - config=config.get_notifier_config(), - keep_alive_monitor=keep_alive_monitor - ) + notify_manager = NotifyManager(config=config.get_notifier_config(), keep_alive_monitor=keep_alive_monitor) # Link stuff up in the log handler # Pipeline: Consume -> Handle -> Notify - log_handler = LogHandler( - log_consumer=log_consumer, - notify_manager=notify_manager - ) - + log_handler = LogHandler(log_consumer=log_consumer, notify_manager=notify_manager) def interrupt(signal_number, frame): if signal_number == signal.SIGINT: @@ -76,6 +72,5 @@ def interrupt(signal_number, frame): keep_alive_monitor.stop() exit(0) - signal.signal(signal.SIGINT, interrupt) signal.pause() diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..e34796e --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,2 @@ +[tool.black] +line-length = 120 \ No newline at end of file diff --git a/src/chia_log/handlers/__init__.py b/src/chia_log/handlers/__init__.py index 4040c52..22a6208 100644 --- a/src/chia_log/handlers/__init__.py +++ b/src/chia_log/handlers/__init__.py @@ -15,8 +15,7 @@ class that analyses a specific part of the log class LogHandler(ABC): - """Common interface for log handlers - """ + """Common interface for log handlers""" @abstractmethod def handle(self, logs: str) -> List[Event]: diff --git a/src/chia_log/handlers/harvester_activity_handler.py b/src/chia_log/handlers/harvester_activity_handler.py index c7a8f46..3060cd9 100644 --- a/src/chia_log/handlers/harvester_activity_handler.py +++ b/src/chia_log/handlers/harvester_activity_handler.py @@ -17,12 +17,7 @@ class HarvesterActivityHandler(LogHandler): def __init__(self): self._parser = HarvesterActivityParser() - self._cond_checkers = [ - TimeSinceLastFarmEvent(), - NonDecreasingPlots(), - QuickPlotSearchTime(), - FoundProofs() - ] + self._cond_checkers = [TimeSinceLastFarmEvent(), NonDecreasingPlots(), QuickPlotSearchTime(), FoundProofs()] def handle(self, logs: str) -> List[Event]: """Process incoming logs, check all conditions @@ -36,12 +31,11 @@ def handle(self, logs: str) -> List[Event]: # activity have been successfully parsed if len(activity_messages) > 0: logging.debug(f"Parsed {len(activity_messages)} activity messages") - events.append(Event( - type=EventType.KEEPALIVE, - priority=EventPriority.NORMAL, - service=EventService.HARVESTER, - message="" - )) + events.append( + Event( + type=EventType.KEEPALIVE, priority=EventPriority.NORMAL, service=EventService.HARVESTER, message="" + ) + ) # Run messages through all condition checkers for msg in activity_messages: @@ -76,14 +70,13 @@ def check(self, obj: HarvesterActivityMessage) -> Optional[Event]: seconds_since_last = (obj.timestamp - self._last_timestamp).seconds if seconds_since_last > self._warning_threshold: - message = f"Harvester did not participate in any challenge for {seconds_since_last} seconds. " \ - f"This might indicate networking issues. It's now working again." + message = ( + f"Harvester did not participate in any challenge for {seconds_since_last} seconds. " + f"This might indicate networking issues. It's now working again." + ) logging.warning(message) event = Event( - type=EventType.USER, - priority=EventPriority.NORMAL, - service=EventService.HARVESTER, - message=message + type=EventType.USER, priority=EventPriority.NORMAL, service=EventService.HARVESTER, message=message ) self._last_timestamp = obj.timestamp @@ -109,10 +102,7 @@ def check(self, obj: HarvesterActivityMessage) -> Optional[Event]: message = f"The total plot count decreased from {self._max_farmed_plots} to {obj.total_plots_count}." logging.warning(message) event = Event( - type=EventType.USER, - priority=EventPriority.HIGH, - service=EventService.HARVESTER, - message=message + type=EventType.USER, priority=EventPriority.HIGH, service=EventService.HARVESTER, message=message ) # Update max plots to prevent repeated alarms @@ -135,10 +125,7 @@ def check(self, obj: HarvesterActivityMessage) -> Optional[Event]: message = f"Seeking plots took too long: {obj.search_time_seconds} seconds!" logging.warning(message) return Event( - type=EventType.USER, - priority=EventPriority.NORMAL, - service=EventService.HARVESTER, - message=message + type=EventType.USER, priority=EventPriority.NORMAL, service=EventService.HARVESTER, message=message ) return None @@ -152,10 +139,7 @@ def check(self, obj: HarvesterActivityMessage) -> Optional[Event]: message = f"Found {obj.found_proofs_count} proofs!" logging.info(message) return Event( - type=EventType.USER, - priority=EventPriority.LOW, - service=EventService.HARVESTER, - message=message + type=EventType.USER, priority=EventPriority.LOW, service=EventService.HARVESTER, message=message ) return None diff --git a/src/chia_log/log_consumer.py b/src/chia_log/log_consumer.py index de385f6..133e294 100644 --- a/src/chia_log/log_consumer.py +++ b/src/chia_log/log_consumer.py @@ -59,8 +59,7 @@ def stop(self): def _consume_loop(self): expanded_user_log_path = self._log_path.expanduser() logging.info(f"Consuming log file from {expanded_user_log_path}") - f = subprocess.Popen(['tail', '-F', expanded_user_log_path], - stdout=subprocess.PIPE, stderr=subprocess.PIPE) + f = subprocess.Popen(["tail", "-F", expanded_user_log_path], stdout=subprocess.PIPE, stderr=subprocess.PIPE) while self._is_running: log_line = f.stdout.readline().decode(encoding="utf-8") self._notify_subscribers(log_line) diff --git a/src/chia_log/log_handler.py b/src/chia_log/log_handler.py index a7570a9..874de13 100644 --- a/src/chia_log/log_handler.py +++ b/src/chia_log/log_handler.py @@ -21,9 +21,7 @@ class LogHandler(LogConsumerSubscriber): def __init__(self, log_consumer: LogConsumer, notify_manager: NotifyManager): log_consumer.subscribe(self) self._notify_manager = notify_manager - self._handlers = [ - HarvesterActivityHandler() - ] + self._handlers = [HarvesterActivityHandler()] def consume_logs(self, logs: str): for handler in self._handlers: diff --git a/src/chia_log/parsers/harvester_activity_parser.py b/src/chia_log/parsers/harvester_activity_parser.py index aa76686..633c6b6 100644 --- a/src/chia_log/parsers/harvester_activity_parser.py +++ b/src/chia_log/parsers/harvester_activity_parser.py @@ -11,6 +11,7 @@ @dataclass class HarvesterActivityMessage: """Parsed information from harvester logs""" + timestamp: datetime eligible_plots_count: int challenge_hash: str @@ -27,9 +28,11 @@ class HarvesterActivityParser: """ def __init__(self): - self._regex = re.compile(r'([0-9:.]*) harvester src.harvester.harvester : INFO\s*([0-9]) plots were ' - r'eligible for farming ([0-9a-z.]*) Found ([0-9]) proofs. Time: ([0-9.]*) s. ' - r'Total ([0-9]*) plots') + self._regex = re.compile( + r"([0-9:.]*) harvester src.harvester.harvester : INFO\s*([0-9]) plots were " + r"eligible for farming ([0-9a-z.]*) Found ([0-9]) proofs. Time: ([0-9.]*) s. " + r"Total ([0-9]*) plots" + ) def parse(self, logs: str) -> List[HarvesterActivityMessage]: """Parses all harvester activity messages from a bunch of logs @@ -41,13 +44,15 @@ def parse(self, logs: str) -> List[HarvesterActivityMessage]: parsed_messages = [] matches = self._regex.findall(logs) for match in matches: - parsed_messages.append(HarvesterActivityMessage( - timestamp=dateutil_parser.parse(match[0]), - eligible_plots_count=int(match[1]), - challenge_hash=match[2], - found_proofs_count=int(match[3]), - search_time_seconds=float(match[4]), - total_plots_count=int(match[5]) - )) + parsed_messages.append( + HarvesterActivityMessage( + timestamp=dateutil_parser.parse(match[0]), + eligible_plots_count=int(match[1]), + challenge_hash=match[2], + found_proofs_count=int(match[3]), + search_time_seconds=float(match[4]), + total_plots_count=int(match[5]), + ) + ) return parsed_messages diff --git a/src/config.py b/src/config.py index 02c9785..998494f 100644 --- a/src/config.py +++ b/src/config.py @@ -10,7 +10,7 @@ def __init__(self, config_path: Path): if not config_path.is_file(): raise ValueError(f"Invalid config.yaml path: {config_path}") - with open(config_path, 'r') as config_file: + with open(config_path, "r") as config_file: self._config = yaml.safe_load(config_file) def _get_child_config(self, key): diff --git a/src/notifier/keep_alive_monitor.py b/src/notifier/keep_alive_monitor.py index 60ea5e4..3a3199b 100644 --- a/src/notifier/keep_alive_monitor.py +++ b/src/notifier/keep_alive_monitor.py @@ -21,25 +21,23 @@ class KeepAliveMonitor: def __init__(self, thresholds: dict = None): self._notify_manager = None - self._last_keep_alive = { - EventService.HARVESTER: datetime.now() - } - self._last_keep_alive_threshold_seconds = thresholds or { - EventService.HARVESTER: 300 - } + self._last_keep_alive = {EventService.HARVESTER: datetime.now()} + self._last_keep_alive_threshold_seconds = thresholds or {EventService.HARVESTER: 300} # Infer check period from minimum threshold (arbitrary decision) # Note that this period defines how often high priority notifications # will be re-triggered so < 5 min is not recommended - self._check_period = float('inf') + self._check_period = float("inf") for threshold in self._last_keep_alive_threshold_seconds.values(): self._check_period = min(threshold, self._check_period) logging.info(f"Keep-alive check period: {self._check_period} seconds") if self._check_period < 300: - logging.warning("Check period below 5 minutes might result " - "in very frequent high priority notifications " - "in case something stops working. Is it intended?") + logging.warning( + "Check period below 5 minutes might result " + "in very frequent high priority notifications " + "in case something stops working. Is it intended?" + ) # Start thread self._is_running = True @@ -67,12 +65,14 @@ def check_last_keep_alive(self): if seconds_since_last > self._last_keep_alive_threshold_seconds[service]: message = f"No keep-alive events from harvester for the past {seconds_since_last} seconds" logging.warning(message) - events.append(Event( - type=EventType.USER, - priority=EventPriority.HIGH, - service=EventService.HARVESTER, - message=message - )) + events.append( + Event( + type=EventType.USER, + priority=EventPriority.HIGH, + service=EventService.HARVESTER, + message=message, + ) + ) if len(events): if self._notify_manager: self._notify_manager.process_events(events) diff --git a/src/notifier/notify_manager.py b/src/notifier/notify_manager.py index 701a679..fc31774 100644 --- a/src/notifier/notify_manager.py +++ b/src/notifier/notify_manager.py @@ -22,9 +22,7 @@ def __init__(self, config: dict, keep_alive_monitor: KeepAliveMonitor = None): self._initialize_notifiers() def _initialize_notifiers(self): - key_notifier_mapping = { - "pushover": PushoverNotifier - } + key_notifier_mapping = {"pushover": PushoverNotifier} for key in self._config.keys(): if key not in key_notifier_mapping.keys(): logging.warning(f"Cannot find mapping for {key} notifier.") diff --git a/src/notifier/pushover_notifier.py b/src/notifier/pushover_notifier.py index dc69212..26a51d1 100644 --- a/src/notifier/pushover_notifier.py +++ b/src/notifier/pushover_notifier.py @@ -13,8 +13,8 @@ def __init__(self, config: dict): logging.info("Initializing Pushover notifier.") super().__init__() try: - self.token = config['api_token'] - self.user = config['user_key'] + self.token = config["api_token"] + self.user = config["user_key"] except KeyError as key: logging.error(f"Invalid config.yaml. Missing key: {key}") @@ -23,14 +23,20 @@ def send_events_to_user(self, events: List[Event]) -> bool: for event in events: if event.type == EventType.USER: conn = http.client.HTTPSConnection("api.pushover.net:443") - conn.request("POST", "/1/messages.json", - urllib.parse.urlencode({ - "token": self.token, - "user": self.user, - "title": f"Chia {event.service.name}", - "message": event.message, - "priority": event.priority.value - }), {"Content-type": "application/x-www-form-urlencoded"}) + conn.request( + "POST", + "/1/messages.json", + urllib.parse.urlencode( + { + "token": self.token, + "user": self.user, + "title": f"Chia {event.service.name}", + "message": event.message, + "priority": event.priority.value, + } + ), + {"Content-type": "application/x-www-form-urlencoded"}, + ) response = conn.getresponse() if response.getcode() != 200: logging.warning(f"Problem sending event to user, code: {response.getcode()}") diff --git a/tests/chia_log/handlers/test_harvester_activity_handler.py b/tests/chia_log/handlers/test_harvester_activity_handler.py index f82b678..5d4fc49 100644 --- a/tests/chia_log/handlers/test_harvester_activity_handler.py +++ b/tests/chia_log/handlers/test_harvester_activity_handler.py @@ -10,10 +10,10 @@ class TestHarvesterActivityHandler(unittest.TestCase): def setUp(self) -> None: self.handler = harvester_activity_handler.HarvesterActivityHandler() - self.example_logs_path = Path(__file__).resolve().parents[1] / 'logs/harvester_activity' + self.example_logs_path = Path(__file__).resolve().parents[1] / "logs/harvester_activity" def testNominal(self): - with open(self.example_logs_path / 'nominal.txt') as f: + with open(self.example_logs_path / "nominal.txt") as f: logs = f.readlines() # Third log should trigger an event for a found proof @@ -32,7 +32,7 @@ def testNominal(self): self.assertEqual(events[1].message, "Found 1 proofs!") def testDecreasedPlots(self): - with open(self.example_logs_path / 'plots_decreased.txt') as f: + with open(self.example_logs_path / "plots_decreased.txt") as f: logs = f.readlines() # Fourth log should trigger an event for a decreased plot count @@ -51,7 +51,7 @@ def testDecreasedPlots(self): self.assertEqual(events[1].message, "The total plot count decreased from 43 to 30.") def testLostSyncTemporarily(self): - with open(self.example_logs_path / 'lost_sync_temporary.txt') as f: + with open(self.example_logs_path / "lost_sync_temporary.txt") as f: logs = f.readlines() # Fourth log should trigger an event for harvester outage @@ -67,11 +67,14 @@ def testLostSyncTemporarily(self): self.assertEqual(events[1].type, EventType.USER, "Unexpected event type") self.assertEqual(events[1].priority, EventPriority.NORMAL, "Unexpected priority") self.assertEqual(events[1].service, EventService.HARVESTER, "Unexpected service") - self.assertEqual(events[1].message, "Harvester did not participate in any challenge for 608 seconds. " - "This might indicate networking issues. It's now working again.") + self.assertEqual( + events[1].message, + "Harvester did not participate in any challenge for 608 seconds. " + "This might indicate networking issues. It's now working again.", + ) def testSlowSeekTime(self): - with open(self.example_logs_path / 'slow_seek_time.txt') as f: + with open(self.example_logs_path / "slow_seek_time.txt") as f: logs = f.readlines() for log in logs: @@ -83,5 +86,5 @@ def testSlowSeekTime(self): self.assertEqual(events[1].message, "Seeking plots took too long: 28.12348 seconds!") -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/tests/chia_log/parsers/test_harvester_activity_parser.py b/tests/chia_log/parsers/test_harvester_activity_parser.py index c878648..b2cc1a9 100644 --- a/tests/chia_log/parsers/test_harvester_activity_parser.py +++ b/tests/chia_log/parsers/test_harvester_activity_parser.py @@ -9,8 +9,8 @@ class TestHarvesterActivityParser(unittest.TestCase): def setUp(self) -> None: self.parser = harvester_activity_parser.HarvesterActivityParser() - self.example_logs_path = Path(__file__).resolve().parents[1] / 'logs/harvester_activity' - with open(self.example_logs_path / 'nominal.txt') as f: + self.example_logs_path = Path(__file__).resolve().parents[1] / "logs/harvester_activity" + with open(self.example_logs_path / "nominal.txt") as f: self.nominal_logs = f.read() def tearDown(self) -> None: @@ -23,11 +23,13 @@ def testBasicParsing(self): expected_proofs_found_counts = [0, 0, 1, 0, 0] expected_search_times = [0.55515, 1.05515, 0.23412, 0.12348, 0.34952] expected_total_plots_counts = [42, 42, 42, 43, 43] - for msg, eligible, found, search, total in zip(activity_messages, - expected_eligible_plot_counts, - expected_proofs_found_counts, - expected_search_times, - expected_total_plots_counts): + for msg, eligible, found, search, total in zip( + activity_messages, + expected_eligible_plot_counts, + expected_proofs_found_counts, + expected_search_times, + expected_total_plots_counts, + ): self.assertEqual(msg.eligible_plots_count, eligible, "Eligible plots count don't match") self.assertEqual(msg.found_proofs_count, found, "Found proofs count don't match") self.assertEqual(msg.search_time_seconds, search, "Search time seconds don't match") @@ -41,5 +43,5 @@ def testBasicParsing(self): prev_timestamp = msg.timestamp -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/tests/notifier/test_keep_alive_monitor.py b/tests/notifier/test_keep_alive_monitor.py index 46cebd4..1cfc22d 100644 --- a/tests/notifier/test_keep_alive_monitor.py +++ b/tests/notifier/test_keep_alive_monitor.py @@ -24,14 +24,9 @@ def process_events(self, events: List[Event]): class TestKeepAliveMonitor(unittest.TestCase): def setUp(self) -> None: self.threshold_seconds = 3 - self.keep_alive_monitor = KeepAliveMonitor(thresholds={ - EventService.HARVESTER: self.threshold_seconds - }) + self.keep_alive_monitor = KeepAliveMonitor(thresholds={EventService.HARVESTER: self.threshold_seconds}) self.keep_alive_event = Event( - type=EventType.KEEPALIVE, - priority=EventPriority.NORMAL, - service=EventService.HARVESTER, - message="" + type=EventType.KEEPALIVE, priority=EventPriority.NORMAL, service=EventService.HARVESTER, message="" ) def tearDown(self) -> None: @@ -67,5 +62,5 @@ def callback(events: List[Event]): self.assertGreater(seconds_elapsed, 2 * self.threshold_seconds - 1) -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/tests/notifier/test_pushover_notifier.py b/tests/notifier/test_pushover_notifier.py index bd070c0..8c6c36d 100644 --- a/tests/notifier/test_pushover_notifier.py +++ b/tests/notifier/test_pushover_notifier.py @@ -8,53 +8,54 @@ class TestPushoverNotifier(unittest.TestCase): - def setUp(self) -> None: api_token = os.getenv("PUSHOVER_API_TOKEN") user_key = os.getenv("PUSHOVER_USER_KEY") self.assertIsNotNone(api_token, "You must export PUSHOVER_API_TOKEN as env variable") self.assertIsNotNone(user_key, "You must export PUSHOVER_USER_KEY as env variable") - self.notifier = PushoverNotifier(config={ - 'enable': True, - 'api_token': api_token, - 'user_key': user_key - }) + self.notifier = PushoverNotifier(config={"enable": True, "api_token": api_token, "user_key": user_key}) def testLowPrioriyNotifications(self): - errors = self.notifier.send_events_to_user(events=[ - Event( - type=EventType.USER, - priority=EventPriority.LOW, - service=EventService.HARVESTER, - message="Low priority notification 1." - ), - Event( - type=EventType.USER, - priority=EventPriority.LOW, - service=EventService.HARVESTER, - message="Low priority notification 2." - ) - ]) + errors = self.notifier.send_events_to_user( + events=[ + Event( + type=EventType.USER, + priority=EventPriority.LOW, + service=EventService.HARVESTER, + message="Low priority notification 1.", + ), + Event( + type=EventType.USER, + priority=EventPriority.LOW, + service=EventService.HARVESTER, + message="Low priority notification 2.", + ), + ] + ) self.assertFalse(errors) def testNormalPrioriyNotifications(self): - errors = self.notifier.send_events_to_user(events=[ - Event( - type=EventType.USER, - priority=EventPriority.NORMAL, - service=EventService.HARVESTER, - message="Normal priority notification." - ) - ]) + errors = self.notifier.send_events_to_user( + events=[ + Event( + type=EventType.USER, + priority=EventPriority.NORMAL, + service=EventService.HARVESTER, + message="Normal priority notification.", + ) + ] + ) self.assertFalse(errors) def testHighPrioriyNotifications(self): - errors = self.notifier.send_events_to_user(events=[ - Event( - type=EventType.USER, - priority=EventPriority.HIGH, - service=EventService.HARVESTER, - message="This is a high priority notification!" - ) - ]) + errors = self.notifier.send_events_to_user( + events=[ + Event( + type=EventType.USER, + priority=EventPriority.HIGH, + service=EventService.HARVESTER, + message="This is a high priority notification!", + ) + ] + ) self.assertFalse(errors) diff --git a/tests/test_config.py b/tests/test_config.py index 203cd72..935df1b 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -12,9 +12,9 @@ def setUp(self) -> None: def testBasic(self): with self.assertRaises(ValueError): - _ = Config(self.config_dir / 'wrong.yaml') + _ = Config(self.config_dir / "wrong.yaml") - config = Config(self.config_dir / 'config-example.yaml') + config = Config(self.config_dir / "config-example.yaml") notifier_config = config.get_notifier_config() self.assertEqual(notifier_config["pushover"]["enable"], False) self.assertEqual(notifier_config["pushover"]["api_token"], "dummy_token") @@ -25,5 +25,5 @@ def testBasic(self): self.assertEqual(chia_logs_config["file_log_consumer"]["file_path"], "~/.chia/mainnet/log/debug.log") -if __name__ == '__main__': +if __name__ == "__main__": unittest.main()