Skip to content

Commit

Permalink
Merge pull request #3976 from pyramsd/reto#26
Browse files Browse the repository at this point in the history
Reto #26 - python
  • Loading branch information
Roswell468 authored Jun 30, 2023
2 parents a47f3ac + 417ef74 commit 6a56da4
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions Retos/Reto #26 - TESTING [Media]/python/pyramsd.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import datetime


def viernes_trece(year, month):

date = datetime.date(year, month, 13)

if date.weekday() == 4:
return True
else:
return False


# se espera un resultado falso de la fecha datetime.MAXYEAR(9999) y el mes 1(enero)
def test_invalid_year_1():
assert not viernes_trece(datetime.MAXYEAR, 1)


# se espera un resultado falso de la fecha 1900 de enero
def test_no_viernes_trece():
assert not viernes_trece(1900, 1)


# se espera un resultado verdadero de la fecha 2023 de enero
def test_si_viernes_trece():
assert viernes_trece(2023, 1)

# --!! run: pytest pyramsd.py

0 comments on commit 6a56da4

Please sign in to comment.