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)
示例#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)
示例#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')
示例#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')
示例#5
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')
示例#6
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')