Ejemplo n.º 1
0
    def test_rm_files_absent_file(self):
        # Raises exception
        # This raises actual Exception and fails if lamda is not used???
        # http://stackoverflow.com/questions/6103825/how-to-properly-use-unit-testings-assertraises-with-nonetype-objects
        self.assertRaises(Exception, lambda: utilities.rm_files(["absentfile"], True))

        # No exception
        # This was causing failures as call to log defaults to a file which did not exist
        self.assertTrue(utilities.rm_files(["absentfile"], False) == 0)
    def test_rm_files_absent_file(self):
        # Raises exception
        # This raises actual Exception and fails if lamda is not used???
        # http://stackoverflow.com/questions/6103825/how-to-properly-use-unit-testings-assertraises-with-nonetype-objects
        self.assertRaises(Exception,
                          lambda: utilities.rm_files(["absentfile"], True))

        # No exception
        # This was causing failures as call to log defaults to a file which did not exist
        self.assertTrue(utilities.rm_files(["absentfile"], False) == 0)
 def tearDown(self):
     utilities.rm_files([self.logfile], True)
Ejemplo n.º 4
0
 def tearDown(self):
     utilities.rm_files([self.logfile], True)