From 21bf21a833d2137c0eaa148735afca0ffe1f87d3 Mon Sep 17 00:00:00 2001 From: Giorgio Nocera Date: Tue, 19 Apr 2022 22:55:02 +0200 Subject: [PATCH] feat: :globe_with_meridians: add it_IT automotive provider Adding the ability to provide fake plates (automotive provider) for it_IT locale. --- faker/providers/automotive/it_IT/__init__.py | 15 +++++++++++++++ tests/providers/test_automotive.py | 6 ++++++ 2 files changed, 21 insertions(+) create mode 100644 faker/providers/automotive/it_IT/__init__.py diff --git a/faker/providers/automotive/it_IT/__init__.py b/faker/providers/automotive/it_IT/__init__.py new file mode 100644 index 0000000000..c1545345b2 --- /dev/null +++ b/faker/providers/automotive/it_IT/__init__.py @@ -0,0 +1,15 @@ +from .. import Provider as AutomotiveProvider + + +class Provider(AutomotiveProvider): + """Implement automotive provider for ``it_IT`` locale. + + Sources: + + - https://en.wikipedia.org/wiki/Vehicle_registration_plates_of_Italy + """ + + license_formats = ( + # 1994-present + "??###??", + ) diff --git a/tests/providers/test_automotive.py b/tests/providers/test_automotive.py index 1570c05f75..ded4ebf77d 100644 --- a/tests/providers/test_automotive.py +++ b/tests/providers/test_automotive.py @@ -154,6 +154,12 @@ class TestFrFr(_SimpleAutomotiveTestMixin): license_plate_pattern: Pattern = re.compile(r"\d{3}-[A-Z]{3}-\d{2}|[A-Z]{2}-\d{3}-[A-Z]{2}") +class TestItIt(_SimpleAutomotiveTestMixin): + """Test it_IT automotive provider methods""" + + license_plate_pattern: Pattern = re.compile(r"[A-Z]{2}\d{3}[A-Z]{2}") + + class TestNoNo(_SimpleAutomotiveTestMixin): """Test no_NO automotive provider methods"""