def test_fopenNoPerm(self): os.chmod(self.temp_files["File0"][1], 0o0200) fp = machinestate.fopen(self.temp_files["File0"][1]) self.assertEqual(fp, None) if fp: fp.close() os.chmod(self.temp_files["File0"][1], 0o0644)
def test_fopenDir(self): fp = machinestate.fopen(self.temp_dir) self.assertEqual(fp, None) if fp: fp.close()
def test_fopenNotExist(self): fp = machinestate.fopen(self.temp_files["File0"][1] + "1234") self.assertEqual(fp, None) if fp: fp.close()
def test_fopenNone(self): fp = machinestate.fopen(None) self.assertEqual(fp, None) if fp: fp.close()