Exemplo n.º 1
0
 def test_custom_args(self):
     for prefix in ('libreoffice', 'msoffice'):
         target_file = os.path.join(here, prefix + '_edges_danger_zone.pdf')
         rez = edges_danger_zone.main(target_file=target_file,
                                      min_page_ratio='23')
         compare(rez, [
             dict(id='C1003',
                  msg_name='too-close-to-edges',
                  msg='Too close to edges: Text should not appear '
                  'closer than 1/23.0th of the page size '
                  'to the edges.',
                  help='Too close to edges: Text should not appear '
                  'closer than 1/12th(by default) of the'
                  ' page size to the edges.',
                  page='Slide 1'),
             dict(id='C1003',
                  msg_name='too-close-to-edges',
                  msg='Too close to edges: Text should not appear '
                  'closer than 1/23.0th of the page size '
                  'to the edges.',
                  help='Too close to edges: Text should not appear '
                  'closer than 1/12th(by default) of the'
                  ' page size to the edges.',
                  page='Slide 3')
         ])
Exemplo n.º 2
0
 def test_checker_helpers(self):
     compare(edges_danger_zone.main(msg_info='All'),
             [dict(id='C1003',
                   msg_name='too-close-to-edges',
                   msg='Too close to edges: Text should not appear '
                       'closer than 1/12th(by default) of the'
                       ' page size to the edges.',
                   help='Too close to edges: Text should not appear '
                        'closer than 1/12th(by default) of the'
                        ' page size to the edges.',
                   page='')])
     compare(edges_danger_zone.main(msg_info=['C1003']),
             [dict(id='C1003',
                   msg_name='too-close-to-edges',
                   msg='Too close to edges: Text should not appear '
                       'closer than 1/12th(by default) of the'
                       ' page size to the edges.',
                   help='Too close to edges: Text should not appear '
                        'closer than 1/12th(by default) of the'
                        ' page size to the edges.',
                   page='')])
     compare(edges_danger_zone.main(msg_info=['W8001']),
             [])
Exemplo n.º 3
0
 def test_checker_helpers(self):
     compare(edges_danger_zone.main(msg_info='All'), [
         dict(id='C1003',
              msg_name='too-close-to-edges',
              msg='Too close to edges: Text should not appear '
              'closer than 1/12th(by default) of the'
              ' page size to the edges.',
              help='Too close to edges: Text should not appear '
              'closer than 1/12th(by default) of the'
              ' page size to the edges.',
              page='')
     ])
     compare(edges_danger_zone.main(msg_info=['C1003']), [
         dict(id='C1003',
              msg_name='too-close-to-edges',
              msg='Too close to edges: Text should not appear '
              'closer than 1/12th(by default) of the'
              ' page size to the edges.',
              help='Too close to edges: Text should not appear '
              'closer than 1/12th(by default) of the'
              ' page size to the edges.',
              page='')
     ])
     compare(edges_danger_zone.main(msg_info=['W8001']), [])
Exemplo n.º 4
0
 def test_default(self):
     for prefix in ('libreoffice', 'msoffice'):
         target_file = os.path.join(
             here, prefix+'_edges_danger_zone.pdf')
         rez = edges_danger_zone.main(target_file=target_file)
         compare(rez,
                 [dict(id='C1003', msg_name='too-close-to-edges',
                       msg='Too close to edges: Text should not appear '
                           'closer than 1/12.0th of the page size '
                           'to the edges.',
                       help='Too close to edges: Text should not appear '
                            'closer than 1/12th(by default) of the'
                            ' page size to the edges.',
                       page='Slide 1'),
                  dict(id='C1003', msg_name='too-close-to-edges',
                       msg='Too close to edges: Text should not appear '
                           'closer than 1/12.0th of the page size '
                           'to the edges.',
                       help='Too close to edges: Text should not appear '
                            'closer than 1/12th(by default) of the'
                            ' page size to the edges.',
                       page='Slide 2'),
                  dict(id='C1003', msg_name='too-close-to-edges',
                       msg='Too close to edges: Text should not appear '
                           'closer than 1/12.0th of the page size '
                           'to the edges.',
                       help='Too close to edges: Text should not appear '
                            'closer than 1/12th(by default) of the'
                            ' page size to the edges.',
                       page='Slide 3'),
                  dict(id='C1003', msg_name='too-close-to-edges',
                       msg='Too close to edges: Text should not appear '
                           'closer than 1/12.0th of the page size '
                           'to the edges.',
                       help='Too close to edges: Text should not appear '
                            'closer than 1/12th(by default) of the'
                            ' page size to the edges.',
                       page='Slide 4')])