Example #1
0
    def test_from_file_object_ambiguous_table_specifier(self):
        with open(self.wpp_filename, 'rb') as f:
            extension = tcore.get_extension(self.wpp_filename)

            self.assertRaises(
                TypeError, lambda: xypath.Table.from_file_object(
                    f, extension, table_name='NOTES', table_index=4))
Example #2
0
    def test_from_file_object_ambiguous_table_specifier(self):
        with open(self.wpp_filename, "rb") as f:
            extension = tcore.get_extension(self.wpp_filename)

            self.assertRaises(
                TypeError, lambda: xypath.Table.from_file_object(f, extension, table_name="NOTES", table_index=4)
            )
Example #3
0
 def test_from_file_object_table_name(self):
     with open(self.wpp_filename, 'rb') as f:
         extension = tcore.get_extension(self.wpp_filename)
         new_table = xypath.Table.from_file_object(f,
                                                   extension,
                                                   table_name='NOTES')
     self.assertEqual(1, len(new_table.filter('(2) Including Zanzibar.')))
Example #4
0
 def test_from_file_object_no_table_specifier(self):
     with open(self.wpp_filename, "rb") as f:
         extension = tcore.get_extension(self.wpp_filename)
         self.assertRaises(TypeError, lambda: xypath.Table.from_file_object(f, extension))
Example #5
0
 def test_from_file_object_table_name(self):
     with open(self.wpp_filename, "rb") as f:
         extension = tcore.get_extension(self.wpp_filename)
         new_table = xypath.Table.from_file_object(f, extension, table_name="NOTES")
     self.assertEqual(1, len(new_table.filter("(2) Including Zanzibar.")))
Example #6
0
 def test_from_file_object_no_table_specifier(self):
     with open(self.wpp_filename, 'rb') as f:
         extension = tcore.get_extension(self.wpp_filename)
         self.assertRaises(
             TypeError, lambda: xypath.Table.from_file_object(f, extension))
Example #7
0
 def test_from_file_object_table_index(self):
     with open(self.wpp_filename, 'rb') as f:
         extension = tcore.get_extension(self.wpp_filename)
         new_table = xypath.Table.from_file_object(
             f, extension, table_index=5)
     self.assertEqual(1, len(new_table.filter('(2) Including Zanzibar.')))