From: Brian Warner Date: Mon, 19 May 2008 20:03:00 +0000 (-0700) Subject: filenode: add is_mutable to non-MutableFileNode classes X-Git-Tag: allmydata-tahoe-1.1.0~117 X-Git-Url: https://git.rkrishnan.org/pf/content/%22file:?a=commitdiff_plain;h=40172047a07e52ae61036e96254295d969b92de2;p=tahoe-lafs%2Ftahoe-lafs.git filenode: add is_mutable to non-MutableFileNode classes --- diff --git a/src/allmydata/filenode.py b/src/allmydata/filenode.py index 91eab290..06c1e514 100644 --- a/src/allmydata/filenode.py +++ b/src/allmydata/filenode.py @@ -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 diff --git a/src/allmydata/test/test_filenode.py b/src/allmydata/test/test_filenode.py index 4496a135..6f797b55 100644 --- a/src/allmydata/test/test_filenode.py +++ b/src/allmydata/test/test_filenode.py @@ -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 = {}