Skip to content

Commit

Permalink
Fix korean road address (#2133)
Browse files Browse the repository at this point in the history
  • Loading branch information
semi-yu authored Nov 12, 2024
1 parent d7ad439 commit 901fb6a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
8 changes: 6 additions & 2 deletions faker/providers/address/ko_KR/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,8 +454,12 @@ class Provider(AddressProvider):
"{{building_name}} {{building_dong}}동 ###호",
)
road_formats = (
"{{road_name}}{{road_suffix}}",
"{{road_name}}{{road_number}}{{road_suffix}}",
"{{road_name}}{{road_suffix}} ###",
"{{road_name}}{{road_suffix}} 지하###",
"{{road_name}}{{road_suffix}} ###-##",
"{{road_name}}{{road_number}}{{road_suffix}} ###",
"{{road_name}}{{road_number}}{{road_suffix}} 지하###",
"{{road_name}}{{road_number}}{{road_suffix}} ###-##",
)
road_address_formats = (
"{{metropolitan_city}} {{borough}} {{road}}",
Expand Down
5 changes: 5 additions & 0 deletions tests/providers/test_address.py
Original file line number Diff line number Diff line change
Expand Up @@ -1316,6 +1316,11 @@ def test_building_dong(self, faker, num_samples):
building_dong = faker.building_dong()
assert isinstance(building_dong, str)

def test_road_address(self, faker, num_samples):
for _ in range(num_samples):
road_address = faker.road_address()
assert isinstance(road_address, str)


class TestNeNp:
"""Test ne_NP address provider methods"""
Expand Down

0 comments on commit 901fb6a

Please # to comment.