Permalink
Browse files

test_rename

  • Loading branch information...
1 parent cff4d91 commit 75703230aebbad81142f227d6a37f253a3d3c9b3 @mikejs committed Oct 2, 2009
Showing with 18 additions and 0 deletions.
  1. +18 −0 tests/basic.py
View
@@ -71,6 +71,24 @@ def test_unlink(self):
self.assert_('file' not in os.listdir(self.mount))
+ def test_rename(self):
+ path1 = os.path.join(self.mount, 'file1')
+ path2 = os.path.join(self.mount, 'file2')
+
+ with open(path1, 'w') as w:
+ w.write('file1')
+
+ self.assert_('file1' in os.listdir(self.mount))
+ self.assert_('file2' not in os.listdir(self.mount))
+
+ os.rename(path1, path2)
+
+ self.assert_('file1' not in os.listdir(self.mount))
+ self.assert_('file2' in os.listdir(self.mount))
+
+ with open(path2, 'r') as r:
+ self.assertEquals('file1', r.read())
+
def suite():
suite = unittest.TestSuite()
suite.addTest(BasicGridfsFUSETestCase())

0 comments on commit 7570323

Please sign in to comment.