Exemplo n.º 1
0
 def test_multiple_containers_unchanged_still_deletes(self):
     processed = euf.process_file(self.loc_mult_containers_unchanged[0],
                                  self.loc_mult_containers_unchanged[1])
     self.assertEqual(
         normalize(processed),
         normalize(self.lxml_mult_containers_unchanged_corrected))
Exemplo n.º 2
0
 def test_multiple_boxes_one_box_number(self):
     processed = euf.process_file(self.loc_box_unchanged[0],
                                  self.loc_box_unchanged[1])
     self.assertEqual(normalize(processed),
                      normalize(self.lxml_box_unchanged_corrected))
Exemplo n.º 3
0
 def test_multiple_containers_different_numbers(self):
     processed = euf.process_file(self.loc_box_changed[0],
                                  self.loc_box_changed[1])
     self.assertEqual(processed, "")
Exemplo n.º 4
0
 def test_no_false_positives(self):
     processed = euf.process_file(self.loc_perfect[0], self.loc_perfect[1])
     print(processed)
     self.assertEqual(normalize(processed), normalize(self.lxml_perfect))
Exemplo n.º 5
0
 def test_delete_blank_node(self):
     processed = euf.process_file(self.loc_empty[0], self.loc_empty[1])
     self.assertEqual(normalize(processed),
                      normalize(self.lxml_empty_corrected))
Exemplo n.º 6
0
 def test_append_odd_and_box_number_to_upper_neighbor(self):
     processed = euf.process_file(self.loc_odd_to_parent_node[0],
                                  self.loc_odd_to_parent_node[1])
     self.assertEqual(normalize(processed),
                      normalize(self.lxml_odd_to_parent_node_corrected))
Exemplo n.º 7
0
 def test_extent_only_append_to_upper_neighbor(self):
     processed = euf.process_file(self.loc_extent_to_parent_node[0],
                                  self.loc_extent_to_parent_node[1])
     self.assertEqual(normalize(processed),
                      normalize(self.lxml_extent_to_parent_node_corrected))
Exemplo n.º 8
0
 def test_extent_only_append_to_upper_neighbor(self):
     processed = euf.process_file(self.loc_extent_to_parent_node[0], self.loc_extent_to_parent_node[1])
     self.assertEqual(normalize(processed), normalize(self.lxml_extent_to_parent_node_corrected))
Exemplo n.º 9
0
 def test_failures_write_to_file(self):
     euf.process_file(self.loc_box_changed[0], self.loc_box_changed[1])
     with open("problem_files.csv") as f:
         data = f.read()
     self.assertEquals(data.strip("\n"),
                       self.problem_file_output.strip("\n"))
Exemplo n.º 10
0
 def test_failures_write_to_file(self):
     euf.process_file(self.loc_box_changed[0], self.loc_box_changed[1])
     with open("problem_files.csv") as f:
         data = f.read()
     self.assertEquals(data.strip("\n"), self.problem_file_output.strip("\n"))
Exemplo n.º 11
0
 def test_append_odd_and_box_number_to_upper_neighbor(self):
     processed = euf.process_file(self.loc_odd_to_parent_node[0], self.loc_odd_to_parent_node[1])
     self.assertEqual(normalize(processed), normalize(self.lxml_odd_to_parent_node_corrected))
Exemplo n.º 12
0
 def test_multiple_containers_unchanged_still_deletes(self):
     processed = euf.process_file(self.loc_mult_containers_unchanged[0], self.loc_mult_containers_unchanged[1])
     self.assertEqual(normalize(processed), normalize(self.lxml_mult_containers_unchanged_corrected))
Exemplo n.º 13
0
 def test_multiple_containers_different_numbers(self):
     processed = euf.process_file(self.loc_box_changed[0], self.loc_box_changed[1])
     self.assertEqual(processed, "")
Exemplo n.º 14
0
 def test_multiple_boxes_one_box_number(self):
     processed = euf.process_file(self.loc_box_unchanged[0], self.loc_box_unchanged[1])
     self.assertEqual(normalize(processed), normalize(self.lxml_box_unchanged_corrected))
Exemplo n.º 15
0
 def test_delete_blank_node(self):
     processed = euf.process_file(self.loc_empty[0], self.loc_empty[1])
     self.assertEqual(normalize(processed), normalize(self.lxml_empty_corrected))
Exemplo n.º 16
0
 def test_no_false_positives(self):
     processed = euf.process_file(self.loc_perfect[0], self.loc_perfect[1])
     print(processed)
     self.assertEqual(normalize(processed), normalize(self.lxml_perfect))