From ae7089896cdd071281d137f4c547e95b643fe72a Mon Sep 17 00:00:00 2001 From: jist <95856749+george0st@users.noreply.github.com> Date: Wed, 18 Oct 2023 18:12:19 +0200 Subject: [PATCH] Add color for `cs_CZ` (#1932) --- faker/providers/color/cs_CZ/__init__.py | 23 +++++++++++++++++++++++ tests/providers/test_color.py | 10 ++++++++++ 2 files changed, 33 insertions(+) create mode 100644 faker/providers/color/cs_CZ/__init__.py diff --git a/faker/providers/color/cs_CZ/__init__.py b/faker/providers/color/cs_CZ/__init__.py new file mode 100644 index 0000000000..507f1451a5 --- /dev/null +++ b/faker/providers/color/cs_CZ/__init__.py @@ -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á", + ) diff --git a/tests/providers/test_color.py b/tests/providers/test_color.py index 608277eb8e..9c581e90a1 100644 --- a/tests/providers/test_color.py +++ b/tests/providers/test_color.py @@ -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: @@ -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: + """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"""