Пример #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))
Пример #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)
            )
Пример #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.')))
Пример #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))
Пример #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.")))
Пример #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))
Пример #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.')))