Skip to content

Commit

Permalink
Merge pull request #3954 from Hugovrc/main
Browse files Browse the repository at this point in the history
Reto #26 - Python
  • Loading branch information
Roswell468 authored Jun 28, 2023
2 parents 34b6424 + 7efd006 commit 86709e1
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 86709e1

Please sign in to comment.