diff --git a/tests/test_cpca.py b/tests/test_cpca.py index 6a329433490ffc43090bc8402c4c7603b3a96b3b..be74beae7d655caff29e3640de1b63a0fa383222 100644 --- a/tests/test_cpca.py +++ b/tests/test_cpca.py @@ -79,14 +79,14 @@ def test_fill_province(monkeypatch): def test_fill_city_1(): pca = Pca('', '', '朝阳区') - cpca._fill_city(pca, {'朝阳区': '北京市'}) + cpca._fill_city(pca, {'朝阳区': '北京市'}, True) assert pca.city == '北京市' def test_fill_city_2(monkeypatch): pca = Pca('', '', '朝阳区') mo_map = mock_map(monkeypatch, 'area_map', '北京市') - cpca._fill_city(pca, {}) + cpca._fill_city(pca, {}, True) mo_map.get_value.assert_called_once_with(pca.area, C) assert pca.city == '北京市' @@ -96,7 +96,7 @@ def test_fill_city_3(monkeypatch): pca = Pca('江苏省', '', '鼓楼区') mock_map(monkeypatch, 'area_map', '', is_contain=True, is_unique_value=False) mo_map = mock_map(monkeypatch, 'province_area_map', '南京市') - cpca._fill_city(pca, {}) + cpca._fill_city(pca, {}, True) mo_map.get_value.assert_called_once_with(('江苏省','鼓楼区'), C) assert pca.city == '南京市' @@ -255,7 +255,7 @@ def test_handle_one_record1(monkeypatch): monkeypatch.setattr(cpca, 'city_map', _dict2addr_map({'淮安': '淮安市', '淮安市': '淮安市'}, {'淮安市':'江苏省'})) monkeypatch.setattr(cpca, 'area_map', _dict2addr_map({'清浦区': '清浦区'}, {'清浦区': '淮安市'})) - result1 = cpca._handle_one_record("清浦区人民路111号", {}, True, 0, True) + result1 = cpca._handle_one_record("清浦区人民路111号", {}, True, 0, True, True) assert result1["省"] == '江苏省' assert result1['市'] == '淮安市' @@ -272,7 +272,7 @@ def test_handle_one_record2(monkeypatch): monkeypatch.setattr(cpca, 'city_map', _dict2addr_map({'淮安': '淮安市', '淮安市': '淮安市'}, {'淮安市':'江苏省'})) monkeypatch.setattr(cpca, 'area_map', _dict2addr_map({'清浦区': '清浦区'}, {'清浦区': '淮安市'})) - result1 = cpca._handle_one_record("清浦区人民路111号", {}, False, 5, True) + result1 = cpca._handle_one_record("清浦区人民路111号", {}, False, 5, True, True) assert result1["省"] == '江苏省' assert result1['市'] == '淮安市' @@ -290,7 +290,7 @@ def test_handle_one_record3(monkeypatch): monkeypatch.setattr(cpca, 'area_map', _dict2addr_map({'清浦区': '清浦区'}, is_unique_value=False)) monkeypatch.setattr(cpca, 'province_area_map', _dict2addr_map({('江苏省', '清浦区'):''}, {('江苏省', '清浦区'):'淮安市'})) - result1 = cpca._handle_one_record("江苏省清浦区人民路111号", {}, False, 5, True) + result1 = cpca._handle_one_record("江苏省清浦区人民路111号", {}, False, 5, True, True) assert result1["省"] == '江苏省' assert result1['市'] == '淮安市'