-
-
Notifications
You must be signed in to change notification settings - Fork 546
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
98 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,8 @@ | ||
modules/__pycache__/ | ||
.*.swp | ||
.ropeproject/ | ||
modules/.ropeproject/ | ||
tests/__pycache__/ | ||
modules/__init__.py | ||
.idea/ | ||
tests/.ropeproject/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,34 @@ | ||
import sys | ||
import os | ||
import unittest | ||
|
||
PACKAGE_PARENT = '..' | ||
SCRIPT_DIR = os.path.dirname(os.path.realpath( | ||
os.path.join(os.getcwd(), os.path.expanduser(__file__)))) | ||
|
||
sys.path.append(os.path.normpath(os.path.join(SCRIPT_DIR, PACKAGE_PARENT))) | ||
|
||
from modules import pagereader, getemails | ||
from io import StringIO | ||
sys.path.append(os.path.abspath('../modules')) | ||
import getemails | ||
from bcolors import Bcolors | ||
import pagereader | ||
from modules.bcolors import Bcolors | ||
|
||
|
||
soup = pagereader.readPage('http://www.whatsmyip.net/') | ||
|
||
|
||
class getMailsTestCase(unittest.TestCase): | ||
|
||
def setUp(self): | ||
self.held, sys.stdout = sys.stdout, StringIO() | ||
|
||
def test_print_emails(self): | ||
data = "\n"+Bcolors.OKGREEN+"Mails Found - "+Bcolors.ENDC+"1\n-------------------------------\n[email protected]\n" | ||
getemails.getMails(soup) | ||
self.assertEqual(sys.stdout.getvalue(),data) | ||
|
||
|
||
def setUp(self): | ||
self.held, sys.stdout = sys.stdout, StringIO() | ||
self.b_colors = Bcolors() | ||
|
||
def test_print_emails(self): | ||
data = ''.join(("\n", self.b_colors.OKGREEN, "Mails Found - ", | ||
self.b_colors.ENDC, "1\n------------------------", | ||
"-------\n[email protected]\n")) | ||
getemails.getMails(soup) | ||
self.assertEqual(sys.stdout.getvalue(), data) | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() | ||
unittest.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,39 @@ | ||
#!/usr/bin/env python | ||
|
||
import unittest | ||
import sys | ||
import os | ||
import unittest | ||
PACKAGE_PARENT = '..' | ||
SCRIPT_DIR = os.path.dirname(os.path.realpath( | ||
os.path.join(os.getcwd(), os.path.expanduser(__file__)))) | ||
|
||
sys.path.append(os.path.normpath(os.path.join(SCRIPT_DIR, PACKAGE_PARENT))) | ||
from io import StringIO | ||
sys.path.append(os.path.abspath('../modules')) | ||
import getweblinks | ||
from bcolors import Bcolors | ||
import pagereader | ||
from modules.bcolors import Bcolors | ||
from modules import getweblinks, pagereader | ||
|
||
soup = pagereader.readPage('http://www.whatsmyip.net/') | ||
|
||
|
||
class getLinksTestCase(unittest.TestCase): | ||
|
||
def setUp(self): | ||
self.held, sys.stdout = sys.stdout, StringIO() | ||
self.maxDiff=None | ||
|
||
def test_print_links(self): | ||
#data = "\nWebsites Found - 7\n-------------------------------\nhttp://ads.wsrs.net/www/delivery/ck.php?n=MyIP856a6b4\nhttp://ads.wsrs.net/www/delivery/ck.php?n=MyIPbf5d683\nhttp://aff.ironsocket.com/SH7L\nhttp://aff.ironsocket.com/SH7L\nhttp://ads.wsrs.net/www/delivery/ck.php?n=MyIPdb5f512\nhttp://wsrs.net/\nhttp://cmsgear.com/\n" | ||
data = "\n"+Bcolors.OKGREEN+"Websites Found - "+Bcolors.ENDC+"1\n-------------------------------\nhttp://cmsgear.com/\n" | ||
ext = ['.com/'] | ||
getweblinks.getLinks(soup,ext) | ||
self.assertEqual(sys.stdout.getvalue(),data) | ||
|
||
def setUp(self): | ||
self.b_colors = Bcolors() | ||
self.held, sys.stdout = sys.stdout, StringIO() | ||
self.maxDiff = None | ||
|
||
def test_print_links(self): | ||
|
||
data = ['http://aff.ironsocket.com/SH7L', | ||
'http://aff.ironsocket.com/SH7L', | ||
'http://wsrs.net/', | ||
'http://cmsgear.com/', | ||
'http://cmsgear.com/'] | ||
|
||
ext = ['.com/'] | ||
result = getweblinks.getLinks(soup, ext) | ||
self.assertEqual(result, data) | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() | ||
unittest.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,38 @@ | ||
import sys | ||
import os | ||
import unittest | ||
from io import StringIO | ||
sys.path.append(os.path.abspath('../modules')) | ||
import getweblinks | ||
from bcolors import Bcolors | ||
import pagereader | ||
import time | ||
PACKAGE_PARENT = '..' | ||
SCRIPT_DIR = os.path.dirname(os.path.realpath( | ||
os.path.join(os.getcwd(), os.path.expanduser(__file__)))) | ||
|
||
sys.path.append(os.path.normpath(os.path.join(SCRIPT_DIR, PACKAGE_PARENT))) | ||
|
||
from io import StringIO | ||
from modules.bcolors import Bcolors | ||
from modules import getweblinks, pagereader | ||
|
||
soup = pagereader.readPage('http://www.whatsmyip.net/') | ||
timestr = time.strftime("%Y%m%d-%H%M%S") | ||
|
||
|
||
class getLinksTestCase(unittest.TestCase): | ||
|
||
def setUp(self): | ||
self.held, sys.stdout = sys.stdout, StringIO() | ||
self.maxDiff=None | ||
|
||
def test_save_links(self): | ||
data = "\n"+Bcolors.OKGREEN+"Websites Found - "+Bcolors.ENDC+"1\n-------------------------------\nhttp://cmsgear.com/\n\nData will be saved with a File Name :"+ "TorBoT-Export-Onion-Links"+timestr+".json\n" | ||
ext = ['.com/'] | ||
getweblinks.getLinks(soup,ext,0,1) | ||
self.assertEqual(sys.stdout.getvalue(),data) | ||
|
||
def setUp(self): | ||
self.held, sys.stdout = sys.stdout, StringIO() | ||
self.maxDiff = None | ||
self.b_colors = Bcolors() | ||
|
||
if __name__ == '__main__': | ||
unittest.main() | ||
def test_save_links(self): | ||
data = ['http://aff.ironsocket.com/SH7L', | ||
'http://aff.ironsocket.com/SH7L', | ||
'http://wsrs.net/', | ||
'http://cmsgear.com/', | ||
'http://cmsgear.com/'] | ||
ext = ['.com/'] | ||
result = getweblinks.getLinks(soup, ext, 0, 1) | ||
self.assertEqual(result, data) | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9c972be
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great Work KingAkeem