Skip to content

Commit

Permalink
Reto mouredev#26 - python
Browse files Browse the repository at this point in the history
  • Loading branch information
Akihiro93 committed Aug 1, 2023
1 parent c9f3a66 commit 4ffefd2
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions Retos/Reto #26 - TESTING [Media]/python/Akihiro93.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# de Akihiro93
from datetime import datetime
import unittest

def viernes_trece (año, mes, dia):
fecha = datetime(año, mes, dia)
dia_es = fecha.strftime("%A")
if dia_es == "Friday":
return True # Cambiado para la verificación
else:
return False # Cambiado para la verificación

class Test (unittest.TestCase):

def test_April (self):
result = viernes_trece(2023, 1, 13)
self.assertTrue(result, "debería ser true" )

def test_February (self):
result = viernes_trece(2045, 2, 13)
self.assertFalse(result, "debería ser False" )

def test_January (self):
result = viernes_trece(2023, 3, 13) # 2023, 10, 13 para causar un fallo
self.assertFalse(result, "debería ser False" )

if __name__ == "main":
unittest.main()

0 comments on commit 4ffefd2

Please sign in to comment.