Skip to content

Commit

Permalink
Add color for cs_CZ (#1932)
Browse files Browse the repository at this point in the history
  • Loading branch information
george0st authored Oct 18, 2023
1 parent 5719028 commit ae70898
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
23 changes: 23 additions & 0 deletions faker/providers/color/cs_CZ/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
from .. import Provider as ColorProvider


class Provider(ColorProvider):
"""Implement color provider for ``cs_CZ`` locale."""

safe_colors = (
"černá",
"kaštanová",
"zelená",
"námořnická",
"olivová",
"fialová",
"zelenomodrá",
"limetková",
"modrá",
"stříbrná",
"šedá",
"žlutá",
"fuchsiová",
"aquamarinová",
"bílá",
)
10 changes: 10 additions & 0 deletions tests/providers/test_color.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from faker.providers.color.hy_AM import Provider as HyAmColorProvider
from faker.providers.color.id_ID import Provider as IdIdColorProvider
from faker.providers.color.sk_SK import Provider as SkSkColorProvider
from faker.providers.color.cs_CZ import Provider as CsCzColorProvider


class TestColorProvider:
Expand Down Expand Up @@ -401,6 +402,15 @@ def test_safe_color_name(self, faker, num_samples):
assert isinstance(safe_color_name, str)
assert safe_color_name in SkSkColorProvider.safe_colors

class TestCsCz:

Check failure on line 405 in tests/providers/test_color.py

View workflow job for this annotation

GitHub Actions / flake8

expected 2 blank lines, found 1
"""Test cs_CZ color provider methods"""

def test_safe_color_name(self, faker, num_samples):
for _ in range(num_samples):
safe_color_name = faker.safe_color_name()
assert isinstance(safe_color_name, str)
assert safe_color_name in CsCzColorProvider.safe_colors


class TestHeIl:
"""Test he_IL color provider methods"""
Expand Down

0 comments on commit ae70898

Please sign in to comment.