Exemplo n.º 1
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)
Exemplo 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)
Exemplo n.º 3
0
    def test_simple(self):
	x = xlistdir(self.tmpdir)

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

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

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

        del x
Exemplo 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)
Exemplo n.º 6
0
    def test_outoforder(self):
	x = xlistdir(self.tmpdir)
	try:
	    y=x[1]
	    self.fail("should raise OutOfOrder")
	except RuntimeError:
	    pass
	del x
Exemplo 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
Exemplo n.º 8
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)
Exemplo 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
Exemplo 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
Exemplo n.º 11
0
 def test_list3(self):
     l = [
         f for f in xlistdir(self.tmpdir) if os.path.isfile(self.tmpdir + f)
     ]
Exemplo n.º 12
0
 def test_list2(self):
     l = [f for f in xlistdir(self.tmpdir)]
Exemplo n.º 13
0
 def test_list(self):
     l = list(xlistdir(self.tmpdir))
Exemplo n.º 14
0
 def test_iter2(self):
     x = xlistdir(self.tmpdir)
     y = x[0]
     for d in iter(x):
         y = d
     del x
Exemplo n.º 15
0
    def test_list2(self):
	l = [ f for f in xlistdir(self.tmpdir)]
Exemplo n.º 16
0
    def test_slice(self):
	x = xlistdir(self.tmpdir)
	buf = [x.next() for i in range(4)]
	del x
Exemplo n.º 17
0
    def test_iter2(self):
	x = xlistdir(self.tmpdir)
	y = x[0]
	for d in iter(x):
	    y = d
	del x
Exemplo n.º 18
0
    def test_noent(self):
	try:
	    xlistdir(self.tmpdir+"nothere")
	    self.fail("should raise OSError")
	except OSError:
	    pass
Exemplo n.º 19
0
    def test_list3(self):
	l = [ f for f in xlistdir(self.tmpdir)
	    if os.path.isfile(self.tmpdir+f)]
Exemplo n.º 20
0
 def test_noent(self):
     try:
         xlistdir(self.tmpdir + "nothere")
         self.fail("should raise OSError")
     except OSError:
         pass
Exemplo n.º 21
0
 def test_slice(self):
     x = xlistdir(self.tmpdir)
     buf = [x.next() for i in range(4)]
     del x
Exemplo n.º 22
0
    def test_list(self):
	l = list(xlistdir(self.tmpdir))