Ejemplo n.º 1
0
 def check(self, testinput, testoutput):
     args       = rewrite_pydoc.parse_cmdline(['-f', testinput, '-o', 'ignored'])
     fname      = rewrite_pydoc.get_input_file_name(args)
     contents   = rewrite_pydoc.read_file_contents(fname)
     rewritten  = rewrite_pydoc.rewrite(contents, '../../../../docs/src/common-text',
                                        '../../../../docs/src/graphics', False)
     expected   = open(testoutput, 'r').read()
     self.assertEqual(rewritten, expected)
Ejemplo n.º 2
0
 def check(self, testinput, testoutput):
     args       = rewrite_pydoc.parse_cmdline(['-f', testinput, '-o', 'ignored'])
     fname      = rewrite_pydoc.get_input_file_name(args)
     contents   = rewrite_pydoc.read_file_contents(fname)
     rewritten  = rewrite_pydoc.rewrite(contents, '../../../../docs/src/common-text',
                                        '../../../../docs/src/common-graphics', False)
     expected   = open(testoutput, 'r').read()
     self.assertEqual(rewritten, expected)
Ejemplo n.º 3
0
 def test_file_read(self):
     args = rewrite_pydoc.parse_cmdline(
         ['-f', 'test/data/001.i', '-o', 'ignored.bar'])
     fname = rewrite_pydoc.get_input_file_name(args)
     contents = rewrite_pydoc.read_file_contents(fname)
     self.assertEqual(contents, 'The contents.\n')
Ejemplo n.º 4
0
 def test_input_file_arg(self):
     args = rewrite_pydoc.parse_cmdline(
         ['-f', 'foo.bar', '-o', 'ignored.bar'])
     fname = rewrite_pydoc.get_input_file_name(args)
     self.assertEqual(fname, 'foo.bar')
Ejemplo n.º 5
0
 def test_graphics_arg(self):
     args = rewrite_pydoc.parse_cmdline(
         ['-f', 'ignored.bar', '-o', 'output.zap', '-g', 'foo'])
     dirname = rewrite_pydoc.get_graphics_dir(args)
     self.assertEqual(dirname, 'foo')
Ejemplo n.º 6
0
 def test_input_file_arg(self):
     args  = rewrite_pydoc.parse_cmdline(['-f', 'foo.bar', '-o', 'ignored.bar'])
     fname = rewrite_pydoc.get_input_file_name(args)
     self.assertEqual(fname, 'foo.bar')
Ejemplo n.º 7
0
 def test_graphics_arg(self):
     args    = rewrite_pydoc.parse_cmdline(['-f', 'ignored.bar', '-o', 'output.zap', '-g', 'foo'])
     dirname = rewrite_pydoc.get_graphics_dir(args)
     self.assertEqual(dirname, 'foo')
Ejemplo n.º 8
0
 def test_file_read(self):
     args  = rewrite_pydoc.parse_cmdline(['-f', 'test/data/001.i', '-o', 'ignored.bar'])
     fname = rewrite_pydoc.get_input_file_name(args)
     contents = rewrite_pydoc.read_file_contents(fname)
     self.assertEqual(contents, 'The contents.\n')