]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
filenode: add is_mutable to non-MutableFileNode classes
authorBrian Warner <warner@allmydata.com>
Mon, 19 May 2008 20:03:00 +0000 (13:03 -0700)
committerBrian Warner <warner@allmydata.com>
Mon, 19 May 2008 20:03:00 +0000 (13:03 -0700)
src/allmydata/filenode.py
src/allmydata/test/test_filenode.py

index 91eab290b984395f2b4851b6d190b8475c515703..06c1e5149875eeeb7fa3f1c5cedab02c0838ed82 100644 (file)
@@ -15,6 +15,9 @@ class FileNode:
     def get_uri(self):
         return self.uri
 
+    def is_mutable(self):
+        return False
+
     def is_readonly(self):
         return True
 
@@ -62,6 +65,9 @@ class LiteralFileNode:
     def get_uri(self):
         return self.uri
 
+    def is_mutable(self):
+        return False
+
     def is_readonly(self):
         return True
 
index 4496a1353ead55df3dcb91cfc1d3d068f02446a3..6f797b553f66ce42eb86d8f75466db8be90f00a7 100644 (file)
@@ -22,6 +22,7 @@ class Node(unittest.TestCase):
         self.failIfEqual(fn1, NotANode())
         self.failUnlessEqual(fn1.get_uri(), u.to_string())
         self.failUnlessEqual(fn1.is_readonly(), True)
+        self.failUnlessEqual(fn1.is_mutable(), False)
         self.failUnlessEqual(fn1.get_readonly_uri(), u.to_string())
         self.failUnlessEqual(fn1.get_size(), 1000)
         d = {}
@@ -40,6 +41,7 @@ class Node(unittest.TestCase):
         self.failIfEqual(fn1, NotANode())
         self.failUnlessEqual(fn1.get_uri(), u.to_string())
         self.failUnlessEqual(fn1.is_readonly(), True)
+        self.failUnlessEqual(fn1.is_mutable(), False)
         self.failUnlessEqual(fn1.get_readonly_uri(), u.to_string())
         self.failUnlessEqual(fn1.get_size(), len(DATA))
         d = {}