Skip to content

Commit

Permalink
Fix French Guiana
Browse files Browse the repository at this point in the history
  • Loading branch information
KJhellico committed Apr 2, 2023
1 parent bb780d5 commit bd155c2
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,9 @@ subdivisions are available:
* - France
- FR
- Departments: Alsace-Moselle, Guadeloupe, Guyane, La Réunion, Martinique, Mayotte, Métropole, Nouvelle-Calédonie, Polynésie Française, Saint-Barthélémy, Saint-Martin, Wallis-et-Futuna
* - French Guiana
- GF
- None; Can also be loaded as country FR, subdivision Guyane
* - French Polynesia
- PF
- None; Can also be loaded as country FR, subdivision Polynésie Française
Expand All @@ -258,9 +261,6 @@ subdivisions are available:
* - Guam
- GU
- None; Can also be loaded as country US, subdivision GU
* - Guyana
- GY
- None; Can also be loaded as country FR, subdivision Guyane
* - Honduras
- HN
- None
Expand Down
2 changes: 1 addition & 1 deletion holidays/countries/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@
from .ethiopia import Ethiopia, ET, ETH
from .finland import Finland, FI, FIN
from .france import France, FR, FRA
from .french_guiana import FrenchGuiana, GF, GUF
from .french_polynesia import FrenchPolynesia, PF, PYF
from .french_southern_territories import FrenchSouthernTerritories, TF, ATF
from .georgia import Georgia, GE, GEO
from .germany import Germany, DE, DEU
from .greece import Greece, GR, GRC
from .guadeloupe import Guadeloupe, GP, GLP
from .guam import Guam, GU, GUM, HolidaysGU
from .guyana import Guyana, GY, GUY
from .honduras import Honduras, HN, HND
from .hongkong import HongKong, HK, HKG
from .hungary import Hungary, HU, HUN
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,22 @@
from holidays.countries.france import FR


class Guyana(FR):
class FrenchGuiana(FR):
# Alias of a FR subdivision that is also officially assigned its own
# country code in ISO 3166-1. See
# https://en.wikipedia.org/wiki/ISO_3166-2:FR#Subdivisions_included_in_ISO_3166-1

country = "GY"
country = "GF"
subdivisions = []

def _populate(self, year: int) -> None:
self.subdiv = "Guyane"
super()._populate(year)


class GY(Guyana):
class GF(FrenchGuiana):
pass


class GUY(Guyana):
class GUF(FrenchGuiana):
pass
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@
# Website: https://github.com/dr-prodigy/python-holidays
# License: MIT (see LICENSE file)

from holidays.countries.guyana import Guyana, GY, GUY
from holidays.countries.french_guiana import FrenchGuiana, GF, GUF
from tests.common import TestCase


class TestGuyana(TestCase):
class TestFrenchGuiana(TestCase):
@classmethod
def setUpClass(cls):
super().setUpClass(Guyana)
super().setUpClass(FrenchGuiana)

def test_country_aliases(self):
self.assertCountryAliases(Guyana, GY, GUY)
self.assertCountryAliases(FrenchGuiana, GF, GUF)

def test_2022(self):
self.assertHolidays(
Expand Down

0 comments on commit bd155c2

Please sign in to comment.