Add unit tests

This commit is contained in:
Marian Steinbach 2018-05-03 11:44:06 +02:00
parent 0450cfaac2
commit 5061ba4a90

17
test.py Normal file
View file

@ -0,0 +1,17 @@
import unittest
import spider
class TestSpider(unittest.TestCase):
def test_derive_test_hostnames1(self):
hn = spider.derive_test_hostnames('www.my-domain.de')
expected = ['my-domain.de', 'www.my-domain.de']
self.assertEqual(hn, expected)
def test_derive_test_hostnames2(self):
hn = spider.derive_test_hostnames('domain.de')
expected = ['domain.de', 'www.domain.d']
self.assertEqual(hn, expected)
if __name__ == '__main__':
unittest.main()