Exemple #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)
    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)
 def test6_writeToFile( self ):
     f = tempfile.mktemp()
     content = "ThisIsATest\n"
     util.writeToFile(content, f)
     self.failUnless(util.readFromFile(f) == content)
     os.unlink(f)
Exemple #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)