replacing assertEquals into assertEqual
[nepi.git] / test / resources / linux / application.py
index b6ccb6f..cdd6fe7 100755 (executable)
@@ -4,9 +4,8 @@
 #    Copyright (C) 2013 INRIA
 #
 #    This program is free software: you can redistribute it and/or modify
-#    it under the terms of the GNU General Public License as published by
-#    the Free Software Foundation, either version 3 of the License, or
-#    (at your option) any later version.
+#    it under the terms of the GNU General Public License version 2 as
+#    published by the Free Software Foundation;
 #
 #    This program is distributed in the hope that it will be useful,
 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -94,15 +93,15 @@ class LinuxApplicationTestCase(unittest.TestCase):
 
         stdout = ec.trace(app, "stdout")
         size = ec.trace(app, "stdout", attr = TraceAttr.SIZE)
-        self.assertEquals(len(stdout), size)
+        self.assertEqual(len(stdout), size)
         
         block = ec.trace(app, "stdout", attr = TraceAttr.STREAM, block = 5, offset = 1)
-        self.assertEquals(block, stdout[5:10])
+        self.assertEqual(block, stdout[5:10])
 
         path = ec.trace(app, "stdout", attr = TraceAttr.PATH)
         rm = ec.get_resource(app)
         p = os.path.join(rm.run_home, "stdout")
-        self.assertEquals(path, p)
+        self.assertEqual(path, p)
 
         ec.shutdown()
 
@@ -141,7 +140,7 @@ main (void)
         ec.wait_finished(app)
 
         out = ec.trace(app, 'stdout')
-        self.assertEquals(out, "Hello, world!\n")
+        self.assertEqual(out, "Hello, world!\n")
 
         ec.shutdown()
 
@@ -157,7 +156,7 @@ main (void)
         ec.set(node, "cleanProcesses", True)
 
         apps = list()
-        for i in xrange(50):
+        for i in range(50):
             app = ec.register_resource("linux::Application")
             cmd = "ping -c5 %s" % self.target 
             ec.set(app, "command", cmd)
@@ -177,15 +176,15 @@ main (void)
         for app in apps:
             stdout = ec.trace(app, 'stdout')
             size = ec.trace(app, 'stdout', attr = TraceAttr.SIZE)
-            self.assertEquals(len(stdout), size)
+            self.assertEqual(len(stdout), size)
             
             block = ec.trace(app, 'stdout', attr = TraceAttr.STREAM, block = 5, offset = 1)
-            self.assertEquals(block, stdout[5:10])
+            self.assertEqual(block, stdout[5:10])
 
             path = ec.trace(app, 'stdout', attr = TraceAttr.PATH)
             rm = ec.get_resource(app)
             p = os.path.join(rm.run_home, 'stdout')
-            self.assertEquals(path, p)
+            self.assertEqual(path, p)
 
         ec.shutdown()