-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathtests_verifier.py
More file actions
34 lines (26 loc) · 895 Bytes
/
tests_verifier.py
File metadata and controls
34 lines (26 loc) · 895 Bytes
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
34
import os
from verifier import Verifier
import verifier
import unittest
# Verification tests
import json
import codecs
TASK_FILE = '201606231548.json'
with codecs.open(TASK_FILE, mode='r', encoding='utf-8') as file:
run_info = json.load(file)
v = Verifier()
class TestVerifer(unittest.TestCase):
def test_handle_errors(self):
l1 = verifier.send_to_retry
verifier.handle_errors()
l2 = verifier.send_to_retry
self.assertGreater(len(l1), len(l2))
self.assertEqual(len(l2), len(l1) + len(run_info['error_list']))
def test_get_path_from_url(self):
path = v.get_path_from_url('http://staging.osf.io/mst3k')
self.assertTrue(os.path.exists(path))
def test_generate_page_dictionary(self):
d1 = v.generate_page_dictionary('wiki/')
self.assertGreater(len(d1), 0)
if __name__ == '__main__':
unittest.main()