replacing assertEquals into assertEqual
[nepi.git] / test / resources / linux / ns3 / ns3simulation.py
index f663e1f..f00dcad 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
@@ -18,6 +17,8 @@
 #
 # Author: Alina Quereilhac <alina.quereilhac@inria.fr>
 
+from __future__ import print_function
+
 from nepi.execution.ec import ExperimentController 
 from nepi.execution.trace import TraceAttr
 
@@ -473,16 +474,16 @@ class LinuxNS3SimulationTest(unittest.TestCase):
                 output = ec.trace(guid, trace)
 
                 size = ec.trace(guid, trace, attr = TraceAttr.SIZE)
-                self.assertEquals(size, len(output))
+                self.assertEqual(size, len(output))
                 self.assertTrue(size > 100)
                 
                 block = ec.trace(guid, trace, attr = TraceAttr.STREAM, block = 5, offset = 1)
-                self.assertEquals(block, output[5:10])
+                self.assertEqual(block, output[5:10])
 
                 trace_path = ec.trace(guid, trace, attr = TraceAttr.PATH)
                 rm = ec.get_resource(guid)
                 path = os.path.join(rm_simu.run_home, rm._trace_filename.get(trace))
-                self.assertEquals(trace_path, path)
+                self.assertEqual(trace_path, path)
 
         ec.shutdown()
 
@@ -745,7 +746,7 @@ class LinuxNS3SimulationTest(unittest.TestCase):
         
         stdout = ec.trace(simu, "stdout")
 
-        print stdout
+        print(stdout)
 
         expected = "20 packets transmitted, 20 received, 0% packet loss"
         self.assertTrue(stdout.find(expected) > -1)