Ejemplo 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)
Ejemplo 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
Ejemplo n.º 3
0
def customers():
    file_path = './test_customer.json'
    parser = Parser()
    data = parser.parsing(file_path=file_path, decoder=CustomerDecoder)
    yield data
Ejemplo 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)