try:
os.stat(d + "/" + name)
return d + "/" + name
- except OSError, e:
+ except OSError as e:
if e.errno != os.errno.ENOENT:
raise
return None
(outremote, errrmote), premote = rexec(command, host, user,
port = env.port, agent = True)
- self.assertEquals(outlocal, outremote)
+ self.assertEqual(outlocal, outremote)
def test_rcopy_list(self):
env = test_environment()
files.extend(names)
os.path.walk(destdir, recls, files)
- origfiles = map(lambda s: os.path.basename(s), [dirpath, f.name, f1.name])
+ origfiles = [os.path.basename(s) for s in [dirpath, f.name, f1.name]]
- self.assertEquals(sorted(origfiles), sorted(files))
+ self.assertEqual(sorted(origfiles), sorted(files))
os.remove(f1.name)
shutil.rmtree(dirpath)
files.extend(names)
os.path.walk(destdir, recls, files)
- origfiles = map(lambda s: os.path.basename(s), [dirpath, f.name, f1.name])
+ origfiles = [os.path.basename(s) for s in [dirpath, f.name, f1.name]]
- self.assertEquals(sorted(origfiles), sorted(files))
+ self.assertEqual(sorted(origfiles), sorted(files))
def test_rproc_manage(self):
env = test_environment()
port = env.port,
agent = True)
- self.assertEquals(status, ProcStatus.RUNNING)
+ self.assertEqual(status, ProcStatus.RUNNING)
rkill(pid, ppid,
host = host,
port = env.port,
agent = True)
- self.assertEquals(status, ProcStatus.FINISHED)
+ self.assertEqual(status, ProcStatus.FINISHED)
if __name__ == '__main__':