-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.py
25 lines (19 loc) · 799 Bytes
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import unittest
from crawler import Balerion
class TestBalarion(unittest.TestCase):
def setUp(self):
pass
def test_full_functioning(self):
self.bela = Balerion('http://rohitjangid.com', 1, 1)
self.assertEqual(10, self.bela.crawl())
def test_no_external(self):
self.bela = Balerion('http://rohitjangid.com', 0, 1)
self.assertEqual(10, self.bela.crawl())
def test_no_external_no_redirect(self):
self.bela = Balerion('http://rohit-nsit08.github.com', 0, 0)
self.assertEqual(1, self.bela.crawl())
def test_external_no_redirect(self):
self.bela = Balerion('http://rohit-nsit08.github.com', 1, 0)
self.assertEqual(1, self.bela.crawl())
if __name__ == '__main__':
unittest.main()