inflab3/dop2_test.py

20 lines
807 B
Python
Raw Permalink Normal View History

2023-07-20 22:06:53 +00:00
import unittest
from dop2 import get_email_server
class MyTestCase(unittest.TestCase):
def test_dop2(self):
self.assertEqual(get_email_server('students.spam@yandex.ru'), 'yandex.ru')
self.assertEqual(get_email_server('mail@gmail.com'), 'gmail.com')
self.assertEqual(get_email_server('example@example.com'), 'example.com')
self.assertEqual(get_email_server('example@example'), 'Fail!')
self.assertEqual(get_email_server('example example'), 'Fail!')
self.assertEqual(get_email_server('@example.com'), 'Fail!')
self.assertEqual(get_email_server('example@example.'), 'Fail!')
self.assertEqual(get_email_server('example@.com'), 'Fail!')
self.assertEqual(get_email_server(''), 'Fail!')
if __name__ == '__main__':
unittest.main()