Commit b861e178 authored by Pawel Boening's avatar Pawel Boening

tests ready

parent cb2ea661
Pipeline #6581 failed with stage
in 6 minutes and 1 second
...@@ -292,88 +292,60 @@ class TestConnection(unittest.TestCase): ...@@ -292,88 +292,60 @@ class TestConnection(unittest.TestCase):
# TODO: # TODO:
#def test_post_invalid_parameter_stability_0(self): def test_post_invalid_parameter_stability_0(self):
#self.send(b'EHLO localhost\r\n') self.assertResponse(250, b'EHLO localhost\r\n')
#self.assertCodeResponse(b'250', check_line_number=False) self.assertResponse(500, b'MAIL wrong input blabla\r\n')
self.assertResponse(250, b'MAIL FROM:<correct.mail@test.de>\r\n')
#self.send(b'MAIL wrong input blabla\r\n')
#self.assertCodeResponse(b'500') def test_post_invalid_parameter_stability_1(self):
self.assertResponse(250, b'EHLO localhost\r\n')
#self.send(b'MAIL FROM:<correct.mail@test.de>\r\n') self.assertResponse(250, b'MAIL FROM:<correct.mail@test.de>\r\n')
#self.assertCodeResponse(b'250') self.assertResponse(500, b'RCPT wrong input blabla\r\n')
self.assertResponse(250, b'RCPT TO:<correct@localhost>\r\n')
#def test_post_invalid_parameter_stability_1(self):
#self.send(b'EHLO localhost\r\n') def test_help(self):
#self.assertCodeResponse(b'250', check_line_number=False) self.assertResponse(250, b'HELP\r\n')
#self.send(b'MAIL FROM:<correct.mail@test.de>\r\n') def test_helo(self):
#self.assertCodeResponse(b'250') self.assertResponse(250, b'HELO localDomain\r\n')
#self.send(b'RCPT wrong input blabla\r\n') def test_helo_dot(self):
#self.assertCodeResponse(b'500') self.assertResponse(250, b'HELO localDomain.de\r\n')
#self.send(b'RCPT TO:<correct@server.test>\r\n') def test_helo_no_domain(self):
#self.assertCodeResponse(b'250') self.assertResponse(501, b'HELO\r\n')
#def test_mail_save(self): def test_ehlo(self):
#self.send(b'HELO localDomain\r\n') self.assertResponse(250, b'EHLO localDomain\r\n')
#self.assertCodeResponse(b'250')
#self.send(b'MAIL FROM:<user0@test.de>\r\n') def test_ehlo(self):
#self.assertCodeResponse(b'250') self.assertResponse(250, b'EHLO localDomain.de\r\n')
#self.send(b'RCPT TO:<user1@server.test>\r\n')
#self.assertCodeResponse(b'250') def test_ehlo_no_domain(self):
#self.send(b'RCPT TO:<user2@server.test>\r\n') self.assertResponse(501, b'EHLO\r\n')
#self.assertCodeResponse(b'250')
#self.send(b'DATA\r\n') def test_mail_no_ehlo(self):
#self.assertCodeResponse(b'354') self.assertResponse(503, b'MAIL FROM:<correct.mail@test.de>\r\n')
#self.send(b'text text\r\n')
#self.send(b'text text\r\n') def test_mail_double_send(self):
#self.send(b'.\r\n') self.assertResponse(250, b'EHLO localDomain\r\n')
#self.assertCodeResponse(b'250') self.assertResponse(250, b'MAIL FROM:<correct.mail@test.de>\r\n')
self.assertResponse(503, b'MAIL FROM:<correct2.mail@test.de>\r\n')
#self.assertTrue(os.path.exists('./mailbox/user1/0.txt'))
#self.assertTrue(os.path.exists('./mailbox/user2/0.txt')) def test_mail_save(self):
self.assertResponse(250, b'HELO localDomain\r\n')
#with open('./mailbox/user1/0.txt') as file: self.assertResponse(250, b'MAIL FROM:<user0@test.de>\r\n')
#readcontent = file.read() self.assertResponse(250, b'RCPT TO:<user1@localhost>\r\n')
#mailcontent = """FROM: user0@test.de\nTO: user1@server.test\nDATA:\ntext text\ntext text\n""" self.assertResponse(250, b'RCPT TO:<user2@localhost>\r\n')
#self.assertTrue(readcontent == mailcontent) self.assertResponse(354, b'DATA\r\n')
self.client.send(b'SOME_RANDOM_TEXT\r\n')
#with open('./mailbox/user2/0.txt') as file: self.client.send(b'SOME_RANDOM_TEXT\r\n')
#readcontent = file.read() self.assertResponse(250, b'.\r\n')
#mailcontent = """FROM: user0@test.de\nTO: user2@server.test\nDATA:\ntext text\ntext text\n"""
#self.assertTrue(readcontent == mailcontent) mail_location = subprocess.check_output(['sudo',
'docker',
#def test_help(self): 'exec',
#self.send(b'HELP\r\n') '{}'.format(self.test_server.docker_id.decode('utf-8')),
#self.assertCodeResponse(b'250') 'grep',
'-r',
#def test_helo(self): 'SOME_RANDOM_TEXT'])
#self.send(b'HELO localDomain\r\n')
#self.assertCodeResponse(b'250')
#def test_helo_no_domain(self):
#self.send(b'HELO\r\n')
#self.assertCodeResponse(b'501')
#def test_ehlo(self):
#self.send(b'EHLO localDomain\r\n')
#self.assertCodeResponse(b'250', check_line_number=False)
#def test_ehlo_no_domain(self):
#self.send(b'EHLO\r\n')
#self.assertCodeResponse(b'501')
#def test_mail_no_ehlo(self):
#self.send(b'MAIL FROM:<correct.mail@test.de>\r\n')
#self.assertCodeResponse(b'503')
#def test_mail_double_send(self):
#self.send(b'EHLO localDomain\r\n')
#self.assertCodeResponse(b'250', check_line_number=False)
#self.send(b'MAIL FROM:<correct.mail@test.de>\r\n')
#self.assertCodeResponse(b'250')
#self.send(b'MAIL FROM:<correct2.mail@test.de>\r\n')
#self.assertCodeResponse(b'503')
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment