diff options
| author | 2021-12-03 14:15:14 +0100 | |
|---|---|---|
| committer | 2021-12-03 14:15:51 +0100 | |
| commit | b062e0f2abc189f352e019bac6854f469e9dfc8c (patch) | |
| tree | 95a7a72cf56061278297f6326c8e3f9519432d53 /aoc/__init__.py | |
| parent | f3c3fa9b94bc61b90a029bb74c98215b45c5be15 (diff) | |
| download | 2021-b062e0f2abc189f352e019bac6854f469e9dfc8c.tar.gz 2021-b062e0f2abc189f352e019bac6854f469e9dfc8c.tar.bz2 2021-b062e0f2abc189f352e019bac6854f469e9dfc8c.zip | |
Added tests
Diffstat (limited to 'aoc/__init__.py')
| -rw-r--r-- | aoc/__init__.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/aoc/__init__.py b/aoc/__init__.py index 07a5fe7..b13489c 100644 --- a/aoc/__init__.py +++ b/aoc/__init__.py | |||
| @@ -4,9 +4,13 @@ from typing import Generator, Any, Iterator | |||
| 4 | 4 | ||
| 5 | 5 | ||
| 6 | class BaseAssignment(ABC): | 6 | class BaseAssignment(ABC): |
| 7 | example_result = NotImplemented | ||
| 7 | def __init__(self, path): | 8 | def __init__(self, path): |
| 8 | self.path = path | 9 | self.path = path |
| 9 | 10 | ||
| 11 | def __str__(self): | ||
| 12 | return f'{self.__module__}.{self.__class__.__name__}' | ||
| 13 | |||
| 10 | def parse_item(self, item: str) -> Any: | 14 | def parse_item(self, item: str) -> Any: |
| 11 | return item | 15 | return item |
| 12 | 16 | ||
| @@ -20,4 +24,4 @@ class BaseAssignment(ABC): | |||
| 20 | yield self.parse_item(line.strip()) | 24 | yield self.parse_item(line.strip()) |
| 21 | 25 | ||
| 22 | def run(self, input: Iterator) -> Any: | 26 | def run(self, input: Iterator) -> Any: |
| 23 | raise NotImplementedError('Please implement run') | 27 | raise NotImplementedError('Please implement run') \ No newline at end of file |
