From 7efd0069ac546cfc8cc2f6333ffe59a93e2f7235 Mon Sep 17 00:00:00 2001 From: Hugovrc Date: Tue, 27 Jun 2023 16:28:56 -0600 Subject: [PATCH] Reto #26 - Python --- .../python/Hugovrc.py | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Retos/Reto #26 - TESTING [Media]/python/Hugovrc.py diff --git a/Retos/Reto #26 - TESTING [Media]/python/Hugovrc.py b/Retos/Reto #26 - TESTING [Media]/python/Hugovrc.py new file mode 100644 index 0000000000..2d33188cc6 --- /dev/null +++ b/Retos/Reto #26 - TESTING [Media]/python/Hugovrc.py @@ -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() + +