Exemplo n.º 1
0
    def test_with_multiples_3(self):
        single_image = 'singleimage'
        no_main_two_subcaptions = ['', ['subcap1', 'subcap2']]

        cur_image, caption, images_and_captions =\
                put_it_together(single_image, no_two_sub_captions,
                                empty_images_and_captions, dummy_line_index,
                                empty_lines, tex_file)
        assert images_and_captions==[('singleimage', 'subcap1 : subcap2')],\
                'didn\'t zip a single image to multiple subcaps correctly'
Exemplo n.º 2
0
    def test_with_singles(self):
        single_image = 'singleimage'
        single_caption = 'singlecaption'

        cur_image, caption, images_and_captions =\
                put_it_together(single_image, single_caption,
                                empty_images_and_captions, dummy_line_index,
                                empty_lines, tex_file)
        assert images_and_captions==[('singleimage', 'singlecaption')],\
               'failed to zip captions correctly'
Exemplo n.º 3
0
 def test_extract_caption(self):
     self.example_lines = ['{some caption}', '[something else]', 'unrelated']
     single_image = 'singleimage'
     no_caption = ''
     single_label = 'singlelabel'
     cur_image, caption, images_and_captions = \
             put_it_together(single_image, no_caption, single_label,
                             self.empty_images_and_captions, 1,
                             self.example_lines)
     self.assertTrue(images_and_captions == [('singleimage', 'some caption', 'singlelabel')], \
             'didn\'t correctly extract the caption for zipping')
Exemplo n.º 4
0
 def test_with_multiples_0(self):
     no_main_two_subs = ['', ['img1', 'img2']]
     single_caption = 'singlecaption'
     single_label = 'singlelabel'
     cur_image, caption, images_and_captions = \
             put_it_together(no_main_two_subs, single_caption, single_label,
                             self.empty_images_and_captions, self.dummy_line_index,
                             self.empty_lines)
     self.assertTrue(images_and_captions == [('img1', 'singlecaption', 'singlelabel'), \
                                  ('img2', 'singlecaption', 'singlelabel')], \
            'didn\'t zip multiple images to one caption correctly')
Exemplo n.º 5
0
    def test_extract_caption(self):
        example_lines = ['{some caption}', '[something else]', 'unrelated']
        single_image = 'singleimage'
        no_caption = ''

        cur_image, caption, images_and_captions =\
                put_it_together(single_image, no_caption,
                                empty_images_and_captions, 1,
                                example_lines, tex_file)
        assert images_and_captions==[('singleimage', 'some caption')],\
                'didn\'t correctly extract the caption for zipping'
Exemplo n.º 6
0
    def test_with_multiples_0(self):
        no_main_two_subs = ['', ['img1', 'img2']]
        single_caption = 'singlecaption'

        cur_image, caption, images_and_captions =\
                put_it_together(no_main_two_subs, single_caption,
                                empty_images_and_captions, dummy_line_index,
                                empty_lines, tex_file)
        assert images_and_captions==[('img1', 'singlecaption'),\
                                     ('img2', 'singlecaption')],\
               'didn\'t zip multiple images to one caption correctly'
Exemplo n.º 7
0
 def test_with_multiples_3(self):
     single_image = 'singleimage'
     no_main_two_subcaptions = ['', ['subcap1', 'subcap2']]
     single_label = 'singlelabel'
     cur_image, caption, images_and_captions = \
             put_it_together(single_image, no_main_two_subcaptions, single_label,
                             self.empty_images_and_captions, self.dummy_line_index,
                             self.empty_lines)
     self.assertTrue(images_and_captions == [('singleimage', 'subcap1 : subcap2', \
                                            'singlelabel')], \
             'didn\'t zip a single image to multiple subcaps correctly')
Exemplo n.º 8
0
    def test_with_multiples_1(self):
        no_main_two_subs = ['', ['sub1', 'sub2']]
        main_and_two_sub_captions = ['main caption', ['subcap1', 'subcap2']]

        cur_image, caption, images_and_captions =\
                put_it_together(no_main_two_subs, main_and_two_sub_captions,
                                empty_images_and_captions, dummy_line_index,
                                empty_lines, tex_file)
        assert images_and_captions == [('sub1', 'main caption : subcap1'),\
                                       ('sub2', 'main caption : subcap2')],\
                'didn\'t zip multiple images to main and subcaps correctly'
Exemplo n.º 9
0
    def test_with_singles(self):
        single_image = 'singleimage'
        single_caption = 'singlecaption'
        single_label = 'singlelabel'

        cur_image, caption, images_and_captions = \
                put_it_together(single_image, single_caption, single_label,
                                self.empty_images_and_captions, self.dummy_line_index,
                                self.empty_lines)
        self.assertTrue(images_and_captions == [('singleimage', 'singlecaption', \
                                               'singlelabel')], \
                                               'failed to zip captions correctly')
Exemplo n.º 10
0
 def test_with_multiples_0(self):
     """plotextractor - put_it_together with multiples"""
     no_main_two_subs = ['', ['img1', 'img2']]
     single_caption = 'singlecaption'
     single_label = 'singlelabel'
     cur_image, caption, images_and_captions = \
             put_it_together(no_main_two_subs, single_caption, single_label,
                             self.empty_images_and_captions, self.dummy_line_index,
                             self.empty_lines)
     self.assertTrue(images_and_captions == [('img1', 'singlecaption', 'singlelabel'), \
                                  ('img2', 'singlecaption', 'singlelabel')], \
            'didn\'t zip multiple images to one caption correctly')
Exemplo n.º 11
0
 def test_with_multiples_3(self):
     """plotextractor - put_it_together with multiples 3"""
     single_image = 'singleimage'
     no_main_two_subcaptions = ['', ['subcap1', 'subcap2']]
     single_label = 'singlelabel'
     cur_image, caption, images_and_captions = \
             put_it_together(single_image, no_main_two_subcaptions, single_label,
                             self.empty_images_and_captions, self.dummy_line_index,
                             self.empty_lines)
     self.assertTrue(images_and_captions == [('singleimage', 'subcap1 : subcap2', \
                                            'singlelabel')], \
             'didn\'t zip a single image to multiple subcaps correctly')
Exemplo n.º 12
0
    def test_with_singles(self):
        """plotextractor - put_it_together with singles"""
        single_image = 'singleimage'
        single_caption = 'singlecaption'
        single_label = 'singlelabel'

        cur_image, caption, images_and_captions = \
                put_it_together(single_image, single_caption, single_label,
                                self.empty_images_and_captions, self.dummy_line_index,
                                self.empty_lines)
        self.assertTrue(images_and_captions == [('singleimage', 'singlecaption', \
                                               'singlelabel')], \
                                               'failed to zip captions correctly')
Exemplo n.º 13
0
 def test_with_multiples_3(self):
     """plotextractor - put_it_together with multiples 3"""
     single_image = 'singleimage'
     no_main_two_subcaptions = ['', ['subcap1', 'subcap2']]
     single_label = 'singlelabel'
     dummy1, dummy2, images_and_captions = \
             put_it_together(single_image, no_main_two_subcaptions, single_label,
                             self.empty_images_and_captions, self.dummy_line_index,
                             self.empty_lines)
     self.assertTrue(images_and_captions == [('singleimage',
                                              'subcap1 : subcap2',
                                              'singlelabel')],
             "didn't zip a single image to multiple subcaps correctly")
Exemplo n.º 14
0
    def test_with_multiples_2(self):
        main_and_two_sub_images = ['main', ['sub1', 'sub2']]
        main_and_two_sub_captions = ['main caption', ['subcap1', 'subcap2']]

        cur_image, caption, images_and_captions =\
                put_it_together(main_and_two_sub_images,
                                main_and_two_sub_captions,
                                empty_images_and_captions, dummy_line_index,
                                empty_lines, tex_file)
        assert images_and_captions==[('main', 'main caption'),
                                     ('sub1', 'main caption : subcap1'),\
                                     ('sub2', 'main caption : subcap2')],\
                'didn\'t zip {main,sub}{images,captions} together properly'
Exemplo n.º 15
0
 def test_with_multiples_1(self):
     no_main_two_subs = ['', ['sub1', 'sub2']]
     main_and_two_sub_captions = ['main caption', ['subcap1', 'subcap2']]
     single_label = 'singlelabel'
     cur_image, caption, images_and_captions = \
             put_it_together(no_main_two_subs, main_and_two_sub_captions, single_label,
                             self.empty_images_and_captions, self.dummy_line_index,
                             self.empty_lines)
     self.assertTrue(images_and_captions == [('sub1', 'main caption : subcap1', \
                                              'singlelabel'), \
                                    ('sub2', 'main caption : subcap2', \
                                     'singlelabel')], \
             'didn\'t zip multiple images to main and subcaps correctly')
Exemplo n.º 16
0
 def test_with_multiples_2(self):
     main_and_two_sub_images = ['main', ['sub1', 'sub2']]
     main_and_two_sub_captions = ['main caption', ['subcap1', 'subcap2']]
     single_label = 'singlelabel'
     cur_image, caption, images_and_captions = \
             put_it_together(main_and_two_sub_images,
                             main_and_two_sub_captions,
                             single_label,
                             self.empty_images_and_captions, self.dummy_line_index,
                             self.empty_lines)
     self.assertTrue(images_and_captions == [('main', 'main caption', 'singlelabel'),
                                  ('sub1', 'main caption : subcap1', 'singlelabel'), \
                                  ('sub2', 'main caption : subcap2', 'singlelabel')], \
             'didn\'t zip {main,sub}{images,captions} together properly')
Exemplo n.º 17
0
    def test_with_singles(self):
        """plotextractor - put_it_together with singles"""
        single_image = 'singleimage'
        single_caption = 'singlecaption'
        single_label = 'singlelabel'

        dummy1, dummy2, images_and_captions = \
                put_it_together(single_image, single_caption, single_label,
                                self.empty_images_and_captions, self.dummy_line_index,
                                self.empty_lines)
        self.assertTrue(images_and_captions == [('singleimage',
                                                 'singlecaption',
                                                 'singlelabel')],
                                            'failed to zip captions correctly')
Exemplo n.º 18
0
 def test_extract_caption(self):
     """plotextractor - put_it_together with extract caption"""
     self.example_lines = [
         '{some caption}', '[something else]', 'unrelated'
     ]
     single_image = 'singleimage'
     no_caption = ''
     single_label = 'singlelabel'
     cur_image, caption, images_and_captions = \
             put_it_together(single_image, no_caption, single_label,
                             self.empty_images_and_captions, 1,
                             self.example_lines)
     self.assertTrue(images_and_captions == [('singleimage', 'some caption', 'singlelabel')], \
             'didn\'t correctly extract the caption for zipping')
Exemplo n.º 19
0
 def test_with_multiples_1(self):
     """plotextractor - put_it_together with multiples 1"""
     no_main_two_subs = ['', ['sub1', 'sub2']]
     main_and_two_sub_captions = ['main caption', ['subcap1', 'subcap2']]
     single_label = 'singlelabel'
     cur_image, caption, images_and_captions = \
             put_it_together(no_main_two_subs, main_and_two_sub_captions, single_label,
                             self.empty_images_and_captions, self.dummy_line_index,
                             self.empty_lines)
     self.assertTrue(images_and_captions == [('sub1', 'main caption : subcap1', \
                                              'singlelabel'), \
                                    ('sub2', 'main caption : subcap2', \
                                     'singlelabel')], \
             'didn\'t zip multiple images to main and subcaps correctly')
Exemplo n.º 20
0
 def test_extract_caption(self):
     """plotextractor - put_it_together with extract caption"""
     example_lines = ['{some caption}', '[something else]', 'unrelated']
     single_image = 'singleimage'
     no_caption = ''
     single_label = 'singlelabel'
     dummy1, dummy2, images_and_captions = \
             put_it_together(single_image, no_caption, single_label,
                             self.empty_images_and_captions, 1,
                             example_lines)
     self.assertTrue(images_and_captions == [('singleimage',
                                              'some caption',
                                              'singlelabel')],
             "didn't correctly extract the caption for zipping")
Exemplo n.º 21
0
 def test_with_multiples_2(self):
     """plotextractor - put_it_together with multiples 2"""
     main_and_two_sub_images = ['main', ['sub1', 'sub2']]
     main_and_two_sub_captions = ['main caption', ['subcap1', 'subcap2']]
     single_label = 'singlelabel'
     cur_image, caption, images_and_captions = \
             put_it_together(main_and_two_sub_images,
                             main_and_two_sub_captions,
                             single_label,
                             self.empty_images_and_captions, self.dummy_line_index,
                             self.empty_lines)
     self.assertTrue(images_and_captions == [('main', 'main caption', 'singlelabel'),
                                  ('sub1', 'main caption : subcap1', 'singlelabel'), \
                                  ('sub2', 'main caption : subcap2', 'singlelabel')], \
             'didn\'t zip {main,sub}{images,captions} together properly')
Exemplo n.º 22
0
 def test_with_multiples_0(self):
     """plotextractor - put_it_together with multiples"""
     no_main_two_subs = ['', ['img1', 'img2']]
     single_caption = 'singlecaption'
     single_label = 'singlelabel'
     dummy1, dummy2, images_and_captions = \
             put_it_together(no_main_two_subs, single_caption, single_label,
                             self.empty_images_and_captions, self.dummy_line_index,
                             self.empty_lines)
     self.assertTrue(images_and_captions == [('img1',
                                              'singlecaption',
                                              'singlelabel'),
                                             ('img2',
                                              'singlecaption',
                                              'singlelabel')],
            "didn't zip multiple images to one caption correctly")
Exemplo n.º 23
0
 def test_with_multiples_1(self):
     """plotextractor - put_it_together with multiples 1"""
     no_main_two_subs = ['', ['sub1', 'sub2']]
     main_and_two_sub_captions = ['main caption', ['subcap1', 'subcap2']]
     single_label = 'singlelabel'
     dummy1, dummy2, images_and_captions = \
             put_it_together(no_main_two_subs, main_and_two_sub_captions, single_label,
                             self.empty_images_and_captions, self.dummy_line_index,
                             self.empty_lines)
     self.assertTrue(images_and_captions == [('sub1',
                                              'main caption : subcap1',
                                              'singlelabel'),
                                             ('sub2',
                                              'main caption : subcap2',
                                              'singlelabel')],
             "didn't zip multiple images to main and subcaps correctly")
Exemplo n.º 24
0
 def test_with_multiples_2(self):
     """plotextractor - put_it_together with multiples 2"""
     main_and_two_sub_images = ['main', ['sub1', 'sub2']]
     main_and_two_sub_captions = ['main caption', ['subcap1', 'subcap2']]
     single_label = 'singlelabel'
     dummy1, dummy2, images_and_captions = \
             put_it_together(main_and_two_sub_images,
                             main_and_two_sub_captions,
                             single_label,
                             self.empty_images_and_captions, self.dummy_line_index,
                             self.empty_lines)
     self.assertTrue(images_and_captions == [('main',
                                              'main caption',
                                              'singlelabel'),
                                             ('sub1',
                                              'main caption : subcap1',
                                              'singlelabel'),
                                             ('sub2',
                                              'main caption : subcap2',
                                              'singlelabel')],
             "didn't zip {main,sub}{images,captions} together properly")