Skip to content

Commit

Permalink
Reto #26 - Python
Browse files Browse the repository at this point in the history
  • Loading branch information
Hugovrc committed Jun 27, 2023
1 parent 093ad5d commit 7efd006
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions Retos/Reto #26 - TESTING [Media]/python/Hugovrc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
from datetime import datetime
import unittest

def FridayThe13th(month, year):
date = datetime(year, month, 13)

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

class test_viernes_13(unittest.TestCase):
def test_1(self):
self.assertTrue(FridayThe13th(1,2023))
def test_2(self):
self.assertEqual(FridayThe13th(1,2025),False)
def test_3(self):
with self.assertRaises(TypeError):
FridayThe13th("01","2026")
def test_4(self):
self.assertEqual(FridayThe13th("1","2023"),True)


if __name__ == '__main__':
unittest.main()


0 comments on commit 7efd006

Please sign in to comment.