-
Notifications
You must be signed in to change notification settings - Fork 0
/
tests.py
33 lines (26 loc) · 1.18 KB
/
tests.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
26
27
28
29
30
31
32
33
import bot
GREEN = '\033[92m'
RED = '\033[91m'
END = '\033[0m'
def print_with_color(outcome, string):
if outcome:
print GREEN + string + ' PASS' + END
else:
print RED + string + ' FAIL' + END
urls = bot.open_config_file()
print_with_color(urls[0] == 'https://mbalamat.site/test.html', 'open_config_file()')
latest_html = bot.load_remote_html(urls[0])
if latest_html is None:
print_with_color(False, 'Getting page was not possible check internet connection or the case of an empty response!')
else:
#print latest_html.prettify()
#print len(latest_html)
print_with_color(True, 'load_remote_html()')
if bot.check_diff(bot.load_remote_html('https://mbalamat.site/test.html'), bot.load_remote_html('https://mbalamat.site/test.html')) == False:
print_with_color(True, 'check_diff(): Same sites as input')
else:
print_with_color(False, 'check_diff(): Same sites as input')
if bot.check_diff(bot.load_remote_html('https://mbalamat.site/test.html'), bot.load_remote_html('https://mbalamat.site/test1.html')) == True:
print_with_color(True, 'check_diff(): Different sites as input')
else:
print_with_color(False, 'check_diff(): Different sites as input')