Skip to content

Commit

Permalink
Add ar_BH automotive provider (#1638)
Browse files Browse the repository at this point in the history
* Add ar_BH automotive provider

* Reformat code

* Update test_automotive.py

Co-authored-by: Flavio Curella <89607+fcurella@users.noreply.github.com>
  • Loading branch information
zerogonal and fcurella committed Apr 27, 2022
1 parent a2ce182 commit b65bceb
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
12 changes: 12 additions & 0 deletions faker/providers/automotive/ar_BH/__init__.py
@@ -0,0 +1,12 @@
from .. import Provider as AutomotiveProvider


class Provider(AutomotiveProvider):
"""Implement automotive provider for ``ar_BH`` locale.
Source:
- https://en.wikipedia.org/wiki/Vehicle_registration_plates_of_Bahrain
"""

license_formats = ("######",)
6 changes: 6 additions & 0 deletions tests/providers/test_automotive.py
Expand Up @@ -280,3 +280,9 @@ def test_plate_motorbike(self, faker, num_samples):
plate = faker.license_plate_motorbike()
assert isinstance(plate, str)
assert self.license_plate_motorbike_pattern.match(plate)


class TestArBh(_SimpleAutomotiveTestMixin):
"""Test ar_BH automotive provider methods"""

license_plate_pattern: Pattern = re.compile(r"\d{6}")

0 comments on commit b65bceb

Please sign in to comment.