Lines Matching refs:os
10 # or http://www.opensolaris.org/os/licensing.
31 import os
50 if os.name == 'posix' and os.getuid() == 0:
52 if os.name == 'posix' and os.getuid() != 0:
67 os.write(fd1, b"foo")
69 os.write(fd2, b"bar")
70 os.close(fd1)
71 os.close(fd2)
73 self.assertFalse(os.path.exists(path1))
74 self.assertTrue(os.path.exists(path2))
75 fd2 = os.open(path2, os.O_RDONLY)
76 self.assertEqual(os.read(fd2, 3), b"foo")
77 os.close(fd2)
78 os.unlink(path2)
84 cwd = os.getcwdu()
86 self.assertTrue(os.path.exists(exefilesrc))
96 exefile = os.path.join(tdir1, 'less.com')
99 self.assertRaises(OSError, os.unlink, exefile)
101 os.write(fd1, b"foo")
102 os.close(fd1)
104 fd2 = os.open(exefile, os.O_RDONLY)
105 self.assertEqual(os.read(fd2, 3), "foo")
106 os.close(fd2)
116 self.assertTrue(not os.path.exists(os.path.join(img1.imgdir,
120 os.chdir(cwd)
127 cwd = os.getcwdu()
129 self.assertTrue(os.path.exists(exefilesrc))
139 exefile = os.path.join(tdir1, 'less.com')
142 self.assertRaises(OSError, os.unlink, exefile)
144 self.assertTrue(not os.path.exists(exefile))
154 self.assertTrue(not os.path.exists(os.path.join(img1.imgdir,
158 os.chdir(cwd)