Esempio n. 1
0
def main():
    strategy = DistanceStrategy(GLOBAL_CIRCLE_DISTANCE)
    file_path = os.path.abspath(FILE_NAME)
    service = InviteService(distance_estimator=strategy)
    data = Parser.parsing(file_path=file_path, decoder=CustomerDecoder)
    result = service.calculate(data)
    FormatterOutput.output(result)
Esempio n. 2
0
def invitees():
    strategy = DistanceStrategy(GLOBAL_CIRCLE_DISTANCE)
    service = InviteService(distance_estimator=strategy)
    file_path = './test_customer.json'
    parser = Parser()
    data = parser.parsing(file_path=file_path, decoder=CustomerDecoder)
    result =  service.calculate(data)
    yield result
Esempio n. 3
0
def customers():
    file_path = './test_customer.json'
    parser = Parser()
    data = parser.parsing(file_path=file_path, decoder=CustomerDecoder)
    yield data
Esempio n. 4
0
def test_parsed_missing_file():
    with pytest.raises(Exception):
        file_path = '../missing_file'
        parser = Parser()
        data = parser.parsing(file_path=file_path, decoder=CustomerDecoder)