コード例 #1
0
    def test7_readFromFile(self):

        # Read from non-existant file.
        self.failUnless(util.readFromFile(tempfile.mktemp()) == None)

        # Read file where we (hopefully) don't have permissions.
        self.failUnless(util.readFromFile("/etc/shadow") == None)
コード例 #2
0
    def test7_readFromFile(self):

        # Read from non-existant file.
        self.failUnless(util.readFromFile(tempfile.mktemp()) == None)

        # Read file where we (hopefully) don't have permissions.
        self.failUnless(util.readFromFile("/etc/shadow") == None)
コード例 #3
0
 def test6_writeToFile( self ):
     f = tempfile.mktemp()
     content = "ThisIsATest\n"
     util.writeToFile(content, f)
     self.failUnless(util.readFromFile(f) == content)
     os.unlink(f)
コード例 #4
0
 def test6_writeToFile(self):
     f = tempfile.mktemp()
     content = "ThisIsATest\n"
     util.writeToFile(content, f)
     self.failUnless(util.readFromFile(f) == content)
     os.unlink(f)