예제 #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'
예제 #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'
예제 #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')
예제 #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')
예제 #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'
예제 #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'
예제 #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')
예제 #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'
예제 #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')
예제 #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')
예제 #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')
예제 #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')
 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")
예제 #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'
예제 #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')
예제 #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')
    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')
예제 #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')
예제 #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')
 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")
예제 #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')
 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")
 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")
 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")