Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Tests for first task
import unittest
import solution
class TestSigns(unittest.TestCase):
def test_aries_sign(self):
self.assertEqual(solution.interpret_western_sign(2, 4), 'aries')
def test_taurus_sign(self):
self.assertEqual(solution.interpret_western_sign(21, 4), 'taurus')
def test_gemini_sign(self):
self.assertEqual(solution.interpret_western_sign(21, 5), 'gemini')
def test_cancer_sign(self):
self.assertEqual(solution.interpret_western_sign(10, 7), 'cancer')
def test_leo_sign(self):
self.assertEqual(solution.interpret_western_sign(27, 7), 'leo')
def test_virgo_sign(self):
self.assertEqual(solution.interpret_western_sign(1, 9), 'virgo')
def test_libra_sign(self):
self.assertEqual(solution.interpret_western_sign(7, 10), 'libra')
def test_scorpio_sign(self):
self.assertEqual(solution.interpret_western_sign(20, 11), 'scorpio')
def test_saggitarius_sign(self):
self.assertEqual(solution.interpret_western_sign(24, 11), 'sagittarius')
def test_aquarius_sign(self):
self.assertEqual(solution.interpret_western_sign(8, 2), 'aquarius')
def test_pisces_sign(self):
self.assertEqual(solution.interpret_western_sign(16, 3), 'pisces')
def test_cancer_sign(self):
self.assertEqual(solution.interpret_western_sign(10, 7), 'cancer')
# not a good practice just showing that this is possbile too.
# also noone posted tests with years before 1900 and after 2015 so.. yea
def test_chinese_signs(self):
self.assertEqual(solution.interpret_chinese_sign(2000), 'dragon')
self.assertEqual(solution.interpret_chinese_sign(1994), 'dog')
self.assertEqual(solution.interpret_chinese_sign(1992), 'monkey')
self.assertEqual(solution.interpret_chinese_sign(1893), 'snake')
self.assertEqual(solution.interpret_chinese_sign(1723), 'rabbit')
self.assertEqual(solution.interpret_chinese_sign(982), 'horse')
self.assertEqual(solution.interpret_chinese_sign(123), 'pig')
self.assertEqual(solution.interpret_chinese_sign(124), 'rat')
self.assertEqual(solution.interpret_chinese_sign(11285), 'ox')
self.assertEqual(solution.interpret_chinese_sign(2015), 'sheep')
self.assertEqual(solution.interpret_chinese_sign(2017), 'rooster')
self.assertEqual(solution.interpret_chinese_sign(-547), 'ox')
def test_aries_snake_signs(self):
self.assertEqual(
solution.interpret_both_signs(18, 4, 1989),
('aries', 'snake')
)
def test_aquarius_pig(self):
self.assertEqual(
solution.interpret_both_signs(23, 1, 2007),
('aquarius', 'pig')
)
def test_leo_rat(self):
self.assertEqual(
solution.interpret_both_signs(26, 7, 1936),
('leo', 'rat')
)
if __name__ == '__main__':
unittest.main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.