def test_basic_conversion_from_file_with_format(self): # This will not work on windows: # http://docs.python.org/2/library/tempfile.html with tempfile.NamedTemporaryFile('w+t', suffix='.rst', delete=False) as test_file: file_name = test_file.name print('test_file = %r' % test_file) print('file_name = %r' % file_name) test_file.write('#some title\n') test_file.flush() expected = 'some title{0}=========={0}{0}'.format(os.linesep) received = docverter.convert(file_name, 'rst', format='md') self.assertEqualExceptForNewlineEnd(expected, received)
def test_basic_conversion_from_string(self): expected = 'some title{0}=========={0}{0}'.format(os.linesep) received = docverter.convert('#some title', 'rst', format='md') self.assertEqualExceptForNewlineEnd(expected, received)