コード例 #1
0
ファイル: file_tests.py プロジェクト: zmy20062010/mkdocs
 def test_copy_file_dirty_not_modified(self, src_dir, dest_dir):
     file = File('test.txt', src_dir, dest_dir, use_directory_urls=False)
     file.is_modified = mock.Mock(return_value=False)
     dest_path = os.path.join(dest_dir, 'test.txt')
     file.copy_file(dirty=True)
     self.assertPathIsFile(dest_path)
     with io.open(dest_path, 'r', encoding='utf-8') as f:
         self.assertEqual(f.read(), 'destination content')
コード例 #2
0
ファイル: file_tests.py プロジェクト: mkdocs/mkdocs
 def test_copy_file_dirty_not_modified(self, src_dir, dest_dir):
     file = File('test.txt', src_dir, dest_dir, use_directory_urls=False)
     file.is_modified = mock.Mock(return_value=False)
     dest_path = os.path.join(dest_dir, 'test.txt')
     file.copy_file(dirty=True)
     self.assertPathIsFile(dest_path)
     with io.open(dest_path, 'r', encoding='utf-8') as f:
         self.assertEqual(f.read(), 'destination content')
コード例 #3
0
ファイル: file_tests.py プロジェクト: zmy20062010/mkdocs
 def test_copy_file(self, src_dir, dest_dir):
     file = File('test.txt', src_dir, dest_dir, use_directory_urls=False)
     dest_path = os.path.join(dest_dir, 'test.txt')
     self.assertPathNotExists(dest_path)
     file.copy_file()
     self.assertPathIsFile(dest_path)
コード例 #4
0
ファイル: file_tests.py プロジェクト: mkdocs/mkdocs
 def test_copy_file(self, src_dir, dest_dir):
     file = File('test.txt', src_dir, dest_dir, use_directory_urls=False)
     dest_path = os.path.join(dest_dir, 'test.txt')
     self.assertPathNotExists(dest_path)
     file.copy_file()
     self.assertPathIsFile(dest_path)