Skip to content

Commit

Permalink
Added currency provider for nl_NL (#1535)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcelRobeer authored Oct 7, 2021
1 parent c7606a9 commit 48dd086
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
9 changes: 9 additions & 0 deletions faker/providers/currency/nl_NL/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from faker.providers.currency import Provider as CurrencyProvider


class Provider(CurrencyProvider):

price_formats = ["#,##", "%#,##", "%##,##", "%.###,##", "%#.###,##"]

def pricetag(self):
return "\N{euro sign}" + self.numerify(self.random_element(self.price_formats))
16 changes: 16 additions & 0 deletions tests/providers/test_currency.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,3 +362,19 @@ def test_pricetag(self, faker, num_samples):
for _ in range(num_samples):
pricetag = faker.pricetag()
assert isinstance(pricetag, str)


class TestNlNl:
"""Test nl_NL currency provider"""

num_samples = 100

@classmethod
def setup_class(cls):
from faker.providers.currency.nl_NL import Provider as NlCurrencyProvider
cls.provider = NlCurrencyProvider

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

0 comments on commit 48dd086

Please sign in to comment.