refactored for easier testing
This commit is contained in:
@@ -1,13 +1,12 @@
|
|||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
from abc import ABC, abstractmethod
|
from abc import ABC, abstractmethod
|
||||||
|
from config import Config
|
||||||
import config
|
|
||||||
|
|
||||||
|
|
||||||
class Connector(ABC):
|
class Connector(ABC):
|
||||||
def __init__(self):
|
def __init__(self, config: Config):
|
||||||
pass
|
self.config = config
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def get_all(self) -> list:
|
def get_all(self) -> list:
|
||||||
@@ -35,9 +34,8 @@ class Connector(ABC):
|
|||||||
|
|
||||||
|
|
||||||
class JSONConnector(Connector):
|
class JSONConnector(Connector):
|
||||||
def __init__(self):
|
def __init__(self, config: Config, ):
|
||||||
super().__init__()
|
super().__init__(config)
|
||||||
self.config = config.Config()
|
|
||||||
self.json_path = self.config.get("json", "path")
|
self.json_path = self.config.get("json", "path")
|
||||||
self.json_file = os.path.join(self.json_path, "brovski-adress-etiketten-verwaltung-v7.json")
|
self.json_file = os.path.join(self.json_path, "brovski-adress-etiketten-verwaltung-v7.json")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user