changeset 595:1476764d3857 pytest2

added test_dir_exist to raise error if dir already exist in util/test_filesys.py
author pkumar <contactprashantat@gmail.com>
date Mon, 27 Jun 2011 23:47:44 +0530
parents 069bb2764aaf
children 837d949a4539
files MoinMoin/util/_tests/test_filesys.py
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/util/_tests/test_filesys.py	Mon Jun 27 18:53:21 2011 +0530
+++ b/MoinMoin/util/_tests/test_filesys.py	Mon Jun 27 23:47:44 2011 +0530
@@ -160,5 +160,13 @@
         filesys.copytree(self.test_dir, self.test_dest_dir)
         # check for the dir contents
         assert os.listdir(self.test_dir) == os.listdir(self.test_dest_dir)        
+
+    def test_dir_exist(self):
+        """ raise Error if dir already exist """
+        self.makefile(self.src1, 'src1')
+        self.test_dest_dir = tempfile.mkdtemp('', 'temp_dir')
+        with pytest.raises(OSError):
+            filesys.copytree(self.test_dir, self.test_dest_dir)
+        
         
 coverage_modules = ['MoinMoin.util.filesys']