Пример #1
0
 def test_add_data_link_present(self, input_data, output_data):
     test_class = 'test_Crawler'
     test_name = 'test_add_data_link_present'
     input_data = input_data[test_class][test_name]
     output_data = output_data[test_class][test_name]
     root = input_data['root']
     size = input_data['size']
     url = input_data['url']
     crawler = Crawler(root, size)
     crawler.data = {root: {root: 1}}
     crawler.add_data(root, url, 1)
     assert crawler.data == output_data
Пример #2
0
 def test_add_data_len_exceeds(self, input_data, output_data):
     test_class = 'test_Crawler'
     test_name = 'test_add_data_len_exceeds'
     input_data = input_data[test_class][test_name]
     output_data = ast.literal_eval(output_data[test_class][test_name])
     root = input_data['root']
     size = input_data['size']
     crawler = Crawler(root, size)
     result = crawler.add_data(root, root, 1)
     assert result == output_data