예제 #1
0
def test_match_data_no_data():
    data = ({'address': ''}, {'address': ''})
    assert next(match_data([data], [])) == data
예제 #2
0
def test_match_data_no_match_algorithm(data_1, data_2):
    with pytest.raises(StopIteration):
        algorithm_pipeline = [lambda row: row, lambda row: row]
        next(match_data([(data_1, data_2)], algorithm_pipeline))
예제 #3
0
def test_match_data_no_algorithm_pipeline(data_1):
    assert next(match_data([(data_1, data_1)], [])) == (data_1, data_1)
예제 #4
0
def test_match_data(data_1, data_2):
    algorithm_pipeline = [lambda row: row, lambda row: 'unter den linden']
    assert next(match_data([(data_1, data_2)],
                           algorithm_pipeline)) == (data_1, data_1)
예제 #5
0
def test_match_data_no_address_field():
    assert next(match_data([({}, {})], [])) == ({}, {})