@@ -377,16 +377,28 @@ def test_holiday_with_exclusion():
377
377
378
378
original_dates = default_uk_spring_bank_holiday .dates (start , end )
379
379
actual_dates = queens_jubilee_uk_spring_bank_holiday .dates (start , end )
380
- print (exclude .isin (original_dates ).all ())
381
380
382
381
assert exclude .isin (original_dates ).all ()
383
382
assert ~ exclude .isin (actual_dates ).all ()
384
383
assert actual_dates .isin (original_dates ).all ()
385
384
385
+ result = queens_jubilee_uk_spring_bank_holiday .dates (start , end )
386
+ expected = DatetimeIndex (
387
+ [
388
+ Timestamp ("2020-05-25" ),
389
+ Timestamp ("2021-05-31" ),
390
+ Timestamp ("2023-05-29" ),
391
+ Timestamp ("2024-05-27" ),
392
+ Timestamp ("2025-05-26" ),
393
+ ],
394
+ dtype = "datetime64[ns]" ,
395
+ )
396
+ tm .assert_index_equal (result , expected )
397
+
386
398
387
399
def test_holiday_with_multiple_exclusions ():
388
- start = Timestamp ("2000 -01-01" )
389
- end = Timestamp ("2100-05 -31" )
400
+ start = Timestamp ("2025 -01-01" )
401
+ end = Timestamp ("2065-12 -31" )
390
402
exclude = DatetimeIndex (
391
403
[
392
404
Timestamp ("2025-01-01" ),
@@ -411,6 +423,52 @@ def test_holiday_with_multiple_exclusions():
411
423
assert ~ exclude .isin (actual_dates ).all ()
412
424
assert actual_dates .isin (original_dates ).all ()
413
425
426
+ result = yakudoshi_new_year .dates (start , end )
427
+ expected = DatetimeIndex (
428
+ [
429
+ Timestamp ("2026-01-01" ),
430
+ Timestamp ("2027-01-01" ),
431
+ Timestamp ("2028-01-01" ),
432
+ Timestamp ("2029-01-01" ),
433
+ Timestamp ("2030-01-01" ),
434
+ Timestamp ("2031-01-01" ),
435
+ Timestamp ("2032-01-01" ),
436
+ Timestamp ("2033-01-01" ),
437
+ Timestamp ("2034-01-01" ),
438
+ Timestamp ("2035-01-01" ),
439
+ Timestamp ("2036-01-01" ),
440
+ Timestamp ("2037-01-01" ),
441
+ Timestamp ("2038-01-01" ),
442
+ Timestamp ("2039-01-01" ),
443
+ Timestamp ("2040-01-01" ),
444
+ Timestamp ("2041-01-01" ),
445
+ Timestamp ("2043-01-01" ),
446
+ Timestamp ("2044-01-01" ),
447
+ Timestamp ("2045-01-01" ),
448
+ Timestamp ("2046-01-01" ),
449
+ Timestamp ("2047-01-01" ),
450
+ Timestamp ("2048-01-01" ),
451
+ Timestamp ("2049-01-01" ),
452
+ Timestamp ("2050-01-01" ),
453
+ Timestamp ("2051-01-01" ),
454
+ Timestamp ("2052-01-01" ),
455
+ Timestamp ("2053-01-01" ),
456
+ Timestamp ("2054-01-01" ),
457
+ Timestamp ("2055-01-01" ),
458
+ Timestamp ("2056-01-01" ),
459
+ Timestamp ("2057-01-01" ),
460
+ Timestamp ("2058-01-01" ),
461
+ Timestamp ("2059-01-01" ),
462
+ Timestamp ("2060-01-01" ),
463
+ Timestamp ("2062-01-01" ),
464
+ Timestamp ("2063-01-01" ),
465
+ Timestamp ("2064-01-01" ),
466
+ Timestamp ("2065-01-01" ),
467
+ ],
468
+ dtype = "datetime64[ns]" ,
469
+ )
470
+ tm .assert_index_equal (result , expected )
471
+
414
472
415
473
def test_exclude_date_value_error ():
416
474
msg = "exclude_dates must be None or of type DatetimeIndex."
0 commit comments