Skip to content

Commit d4886a3

Browse files
committed
Fixed testcases
1 parent e3c75e3 commit d4886a3

5 files changed

Lines changed: 11 additions & 3 deletions

File tree

modules/getemails.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import sys
2+
import os
3+
sys.path.append(os.path.abspath('../'))
14
from modules.bcolors import bcolors
25
import bs4
36

modules/getweblinks.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
import sys
2+
import os
3+
sys.path.append(os.path.abspath('../'))
14
import urllib.request
2-
import modules.bcolors
5+
from modules.bcolors import bcolors
36
import bs4
47

58
"""Get all onion links from the website"""

tests/__init__.py

Whitespace-only changes.

tests/test_getemails.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from io import StringIO
55
sys.path.append(os.path.abspath('../modules'))
66
import getemails
7+
from bcolors import bcolors
78
import pagereader
89

910
soup = pagereader.readPage('http://www.whatsmyip.net/')
@@ -14,10 +15,10 @@ def setUp(self):
1415
self.held, sys.stdout = sys.stdout, StringIO()
1516

1617
def test_print_emails(self):
17-
data = "\nMails Found - 1\n-------------------------------\nadvertise@provaz.eu\n"
18+
data = "\n"+bcolors.OKGREEN+"Mails Found - "+bcolors.ENDC+"1\n-------------------------------\nadvertise@provaz.eu\n"
1819
getemails.getMails(soup)
1920
self.assertEqual(sys.stdout.getvalue(),data)
20-
21+
2122

2223
if __name__ == '__main__':
2324
unittest.main()

tests/test_getweblinks.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from io import StringIO
55
sys.path.append(os.path.abspath('../modules'))
66
import getweblinks
7+
from bcolors import bcolors
78
import pagereader
89

910
soup = pagereader.readPage('http://www.whatsmyip.net/')

0 commit comments

Comments
 (0)