def test_noaccess(self):
	try:
	    name = self.tmpdir+"privatedir"
	    os.mkdir(name,0)
	    xlistdir(name)
	    self.fail("should raise OSError")
	except OSError:
	    pass
	os.rmdir(name)
Esempio n. 2
0
 def test_noaccess(self):
     try:
         name = self.tmpdir + "privatedir"
         os.mkdir(name, 0)
         xlistdir(name)
         self.fail("should raise OSError")
     except OSError:
         pass
     os.rmdir(name)
    def test_simple(self):
	x = xlistdir(self.tmpdir)

	for i in range(5):
	    y = x[i]

	del x
Esempio n. 4
0
    def test_simple(self):
        x = xlistdir(self.tmpdir)

        for i in range(5):
            y = x[i]

        del x
Esempio n. 5
0
 def tearDown(self):
     tmp = self.tmpdir
     for d in xlistdir(tmp):
         try:
             os.unlink(tmp + d)
         except OSError:
             os.rmdir(tmp + d)
     os.rmdir(tmp)
    def test_outoforder(self):
	x = xlistdir(self.tmpdir)
	try:
	    y=x[1]
	    self.fail("should raise OutOfOrder")
	except RuntimeError:
	    pass
	del x
Esempio n. 7
0
 def test_outoforder(self):
     x = xlistdir(self.tmpdir)
     try:
         y = x[1]
         self.fail("should raise OutOfOrder")
     except RuntimeError:
         pass
     del x
    def tearDown(self):
	tmp = self.tmpdir
	for d in xlistdir(tmp):
	    try:
		os.unlink(tmp+d)
	    except OSError:
		os.rmdir(tmp+d)
	os.rmdir(tmp)
Esempio n. 9
0
    def dont_test_big_slice(self):
        """
	XXX fix this: 

	  File "test_xlistdir.py", line 42, in test_big_slice
	    buf = [x.next() for i in range(40)]
	SystemError: error return without exception set
	"""
        x = xlistdir(self.tmpdir)
        buf = [x.next() for i in range(40)]
        del x
Esempio n. 10
0
    def dont_test_big_slice(self):
	"""
	XXX fix this: 

	  File "test_xlistdir.py", line 42, in test_big_slice
	    buf = [x.next() for i in range(40)]
	SystemError: error return without exception set
	"""
	x = xlistdir(self.tmpdir)
	buf = [x.next() for i in range(40)]
	del x
Esempio n. 11
0
 def test_list3(self):
     l = [
         f for f in xlistdir(self.tmpdir) if os.path.isfile(self.tmpdir + f)
     ]
Esempio n. 12
0
 def test_list2(self):
     l = [f for f in xlistdir(self.tmpdir)]
Esempio n. 13
0
 def test_list(self):
     l = list(xlistdir(self.tmpdir))
Esempio n. 14
0
 def test_iter2(self):
     x = xlistdir(self.tmpdir)
     y = x[0]
     for d in iter(x):
         y = d
     del x
Esempio n. 15
0
    def test_list2(self):
	l = [ f for f in xlistdir(self.tmpdir)]
Esempio n. 16
0
    def test_slice(self):
	x = xlistdir(self.tmpdir)
	buf = [x.next() for i in range(4)]
	del x
Esempio n. 17
0
    def test_iter2(self):
	x = xlistdir(self.tmpdir)
	y = x[0]
	for d in iter(x):
	    y = d
	del x
Esempio n. 18
0
    def test_noent(self):
	try:
	    xlistdir(self.tmpdir+"nothere")
	    self.fail("should raise OSError")
	except OSError:
	    pass
Esempio n. 19
0
    def test_list3(self):
	l = [ f for f in xlistdir(self.tmpdir)
	    if os.path.isfile(self.tmpdir+f)]
Esempio n. 20
0
 def test_noent(self):
     try:
         xlistdir(self.tmpdir + "nothere")
         self.fail("should raise OSError")
     except OSError:
         pass
Esempio n. 21
0
 def test_slice(self):
     x = xlistdir(self.tmpdir)
     buf = [x.next() for i in range(4)]
     del x
Esempio n. 22
0
    def test_list(self):
	l = list(xlistdir(self.tmpdir))