File tree Expand file tree Collapse file tree
faker/providers/automotive Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ from .. import Provider as AutomotiveProvider
2+
3+
4+ class Provider (AutomotiveProvider ):
5+ """Implement automotive provider for ``ar_DZ`` locale.
6+
7+ Sources:
8+
9+ - https://en.wikipedia.org/wiki/Vehicle_registration_plates_of_Algeria
10+ """
11+
12+ WILAYA_CODES = tuple (f"{ i :02d} " for i in range (1 , 59 ))
13+ VEHICLE_CLASSES = tuple ("123456789" )
14+
15+ def license_plate (self ) -> str :
16+ serial = self .numerify ("#####" )
17+ vehicle_class = self .random_element (self .VEHICLE_CLASSES )
18+ year = self .numerify ("##" )
19+ wilaya = self .random_element (self .WILAYA_CODES )
20+ return f"{ serial } { vehicle_class } { year } { wilaya } "
Original file line number Diff line number Diff line change 1+ from ..ar_DZ import Provider as ArDzAutomotiveProvider
2+
3+
4+ class Provider (ArDzAutomotiveProvider ):
5+ pass
Original file line number Diff line number Diff line change @@ -55,6 +55,12 @@ class TestAzAz(_SimpleAutomotiveTestMixin):
5555 license_plate_pattern = re .compile (r"\d{2}-[A-Z]{2}-\d{3}" )
5656
5757
58+ class TestArDz (_SimpleAutomotiveTestMixin ):
59+ """Test ar_DZ automotive provider methods"""
60+
61+ license_plate_pattern : Pattern = re .compile (r"\d{5} [1-9]\d{2} (0[1-9]|[1-4]\d|5[0-8])" )
62+
63+
5864class TestDeAt (_SimpleAutomotiveTestMixin ):
5965 """Test de_AT automotive provider methods"""
6066
@@ -162,6 +168,10 @@ class TestFilPh(TestEnPh):
162168 pass
163169
164170
171+ class TestFrDz (TestArDz ):
172+ """Test fr_DZ automotive provider methods"""
173+
174+
165175class TestFrFr (_SimpleAutomotiveTestMixin ):
166176 """Test fr_FR automotive provider methods"""
167177
You can’t perform that action at this time.
0 commit comments