fix some pylint issues 99/90599/1
authorguillaume.lambert <guillaume.lambert@orange.com>
Mon, 22 Jun 2020 22:55:11 +0000 (00:55 +0200)
committerguillaume.lambert <guillaume.lambert@orange.com>
Tue, 23 Jun 2020 07:43:58 +0000 (09:43 +0200)
Signed-off-by: guillaume.lambert <guillaume.lambert@orange.com>
Change-Id: I88f3d068d8199610556e18faaaf850a2f97ebf32

20 files changed:
tests/transportpce_tests/1.2.1/simulators.py
tests/transportpce_tests/1.2.1/test_end2end.py
tests/transportpce_tests/1.2.1/test_gnpy.py
tests/transportpce_tests/1.2.1/test_olm.py
tests/transportpce_tests/1.2.1/test_pce.py
tests/transportpce_tests/1.2.1/test_portmapping.py
tests/transportpce_tests/1.2.1/test_renderer_service_path_nominal.py
tests/transportpce_tests/1.2.1/test_topoPortMapping.py
tests/transportpce_tests/1.2.1/test_topology.py
tests/transportpce_tests/2.2.1/simulators.py
tests/transportpce_tests/2.2.1/test_end2end.py
tests/transportpce_tests/2.2.1/test_olm.py
tests/transportpce_tests/2.2.1/test_otn_renderer.py
tests/transportpce_tests/2.2.1/test_otn_topology.py
tests/transportpce_tests/2.2.1/test_portmapping.py
tests/transportpce_tests/2.2.1/test_renderer_service_path_nominal.py
tests/transportpce_tests/2.2.1/test_tapi.py
tests/transportpce_tests/2.2.1/test_topoPortMapping.py
tests/transportpce_tests/2.2.1/test_topology.py
tests/transportpce_tests/common/test_utils.py

index a44c4660a0b395d9c68f6dfbb5fbbed55d554fe1..79bbcd8f6919fa44a78c252cff4bdb10af4e9e13 100644 (file)
@@ -9,7 +9,7 @@
 ##############################################################################
 import os
 
-sims = {
+SIMS = {
     'xpdra': {'port': '17830', 'configfile': 'oper-XPDRA.xml', 'logfile': 'oper-XPDRA.log'},
     'roadma': {'port': '17831', 'configfile': 'oper-ROADMA.xml', 'logfile': 'oper-ROADMA.log'},
     'roadmb': {'port': '17832', 'configfile': 'oper-ROADMB.xml', 'logfile': 'oper-ROADMB.log'},
@@ -19,9 +19,9 @@ sims = {
     'roadmc-full': {'port': '17823', 'configfile': 'oper-ROADMC-full.xml', 'logfile': 'oper-ROADMC.log'}
 }
 
-honeynode_executable = os.path.join(
+HONEYNODE_EXECUTABLE = os.path.join(
     os.path.dirname(os.path.realpath(__file__)),
     "..", "..", "honeynode", "1.2.1", "honeynode-simulator", "honeycomb-tpce")
-samples_directory = os.path.join(
+SAMPLES_DIRECTORY = os.path.join(
     os.path.dirname(os.path.realpath(__file__)),
     "..", "..", "sample_configs", "openroadm", "1.2.1")
index 03481040ad13caad828f1a112ac823ee3234be94..f23790b3ba0aafcccd32950d7dd5b7b7820da76a 100644 (file)
 
 
 import json
-import signal
 import time
 import unittest
 
-import psutil
 import requests
 from common import test_utils
 
@@ -405,12 +403,8 @@ class TransportPCEFulltesting(unittest.TestCase):
         for ele in liste_tp:
             if ele['tp-id'] == 'XPDR1-NETWORK1':
                 self.assertEqual({u'frequency': 196.1, u'width': 40},
-                                 ele[
-                                     'org-openroadm-network-topology:'
-                                     'xpdr-network-attributes'][
-                                     'wavelength'])
-            if ele['tp-id'] == 'XPDR1-CLIENT1' or \
-               ele['tp-id'] == 'XPDR1-CLIENT3':
+                                 ele['org-openroadm-network-topology:xpdr-network-attributes']['wavelength'])
+            if ele['tp-id'] == 'XPDR1-CLIENT1' or ele['tp-id'] == 'XPDR1-CLIENT3':
                 self.assertNotIn(
                     'org-openroadm-network-topology:xpdr-client-attributes',
                     dict.keys(ele))
@@ -1568,7 +1562,7 @@ class TransportPCEFulltesting(unittest.TestCase):
 
     def test_49_loop_create_eth_service(self):
         for i in range(1, 6):
-            print("trial number {}".format(i))
+            print("iteration number {}".format(i))
             print("eth service creation")
             self.test_11_create_eth_service1()
             print("check xc in ROADMA01")
@@ -1607,7 +1601,7 @@ class TransportPCEFulltesting(unittest.TestCase):
             time.sleep(5)
 
         for i in range(1, 6):
-            print("trial number {}".format(i))
+            print("iteration number {}".format(i))
             print("oc service creation")
             self.test_36_create_oc_service1()
             print("check xc in ROADMA01")
index e7f3a4849a9abf8cc06902e95e6ecbaf10f21806..26ab184b9f7d4850cbf9c6b972ef02df5f2dfd68 100644 (file)
@@ -9,13 +9,11 @@
 # http://www.apache.org/licenses/LICENSE-2.0
 ##############################################################################
 
+import unittest
 import json
 import os
-import psutil
-import requests
-import signal
 import time
-import unittest
+import requests
 from common import test_utils
 
 
index 1f5b736dde84503bd0810942b60a8f3b6b779870..6f32b83a56af694bb5a970e1dec5f54f917cbb1d 100644 (file)
 #############################################################################
 
 import unittest
-import requests
 import time
-import subprocess
-import signal
 import json
-import os
-import psutil
-import shutil
-from unittest.result import failfast
+#from unittest.result import failfast
+import requests
 from common import test_utils
 
 
index fb824f80da930f747fcf583e9d6fb36b9aeff4e9..c33af419a172d12ac174d5480fe3f78742fcbf58 100644 (file)
@@ -8,15 +8,11 @@
 # http://www.apache.org/licenses/LICENSE-2.0
 ##############################################################################
 
+import unittest
 import json
 import os
-import psutil
-import requests
-import signal
-import shutil
-import subprocess
 import time
-import unittest
+import requests
 from common import test_utils
 
 
index 68b74d413aeb4702aaee8558ba397702a4c00249..8b495fa6f538ad52ad144ced00c8875f76373b4b 100644 (file)
@@ -9,12 +9,9 @@
 # http://www.apache.org/licenses/LICENSE-2.0
 ##############################################################################
 
-import json
-import signal
 import unittest
 import time
 import requests
-import psutil
 from common import test_utils
 
 
index 8d2d33de537262e5a19a9a0dcc4a95dcc1863987..68ee4102ba00bdaea74de5a97ff59a39beaf630a 100644 (file)
 #############################################################################
 
 import unittest
-import requests
-import time
-import subprocess
-import signal
 import json
-import os
-import psutil
-import shutil
-from unittest.result import failfast
+import time
+#from unittest.result import failfast
+import requests
 from common import test_utils
 
 
index 369cea38ff8562041c04d37c2641f154e71c9b1e..712dfe1790af7b464aea2f5e8b3739c1b8c97c80 100644 (file)
@@ -9,12 +9,9 @@
 # http://www.apache.org/licenses/LICENSE-2.0
 ##############################################################################
 
-import json
-import signal
 import time
 import unittest
 import requests
-import psutil
 from common import test_utils
 
 
index 5f5d5abf78a9a44afd628a3e49f288bf055b0a1e..24847612b4b51d1481d9c33bb42df0bf4431b3b7 100644 (file)
 ##############################################################################
 
 import json
-import signal
 import time
 import unittest
 import requests
-import psutil
 from common import test_utils
 
 
index 8892226c83a71dc4962fce2d97fbbdaf1180b9f1..730acbab7464a79290b3e6f50a98ffc0c0678e28 100644 (file)
@@ -10,7 +10,7 @@
 
 import os
 
-sims = {
+SIMS = {
     'xpdra': {'port': '17840', 'configfile': 'oper-XPDRA.xml', 'logfile': 'oper-XPDRA.log'},
     'roadma': {'port': '17841', 'configfile': 'oper-ROADMA.xml', 'logfile': 'oper-ROADMA.log'},
     'roadmb': {'port': '17842', 'configfile': 'oper-ROADMB.xml', 'logfile': 'oper-ROADMB.log'},
@@ -20,9 +20,9 @@ sims = {
     'spdrav1': {'port': '17846', 'configfile': 'oper-SPDRAv1.xml', 'logfile': 'oper-SPDRAv1.log'}
 }
 
-honeynode_executable = os.path.join(
+HONEYNODE_EXECUTABLE = os.path.join(
     os.path.dirname(os.path.realpath(__file__)),
     "..", "..", "honeynode", "2.2.1", "honeynode-simulator", "honeycomb-tpce")
-samples_directory = os.path.join(
+SAMPLES_DIRECTORY = os.path.join(
     os.path.dirname(os.path.realpath(__file__)),
     "..", "..", "sample_configs", "openroadm", "2.2.1")
index dd92540c44aca23052cdf7f550304b19a8225941..6555bcf154963c6baf0f83fa79be317107774770 100644 (file)
@@ -9,15 +9,10 @@
 ##############################################################################
 
 
+import unittest
 import json
-import os
-import psutil
-import requests
-import signal
-import shutil
-import subprocess
 import time
-import unittest
+import requests
 from common import test_utils
 
 
@@ -1370,7 +1365,7 @@ class TransportPCEFulltesting(unittest.TestCase):
 
     def test_49_loop_create_eth_service(self):
         for i in range(1, 6):
-            print("trial number {}".format(i))
+            print("iteration number {}".format(i))
             print("eth service creation")
             self.test_11_create_eth_service1()
             print("check xc in ROADM-A1")
@@ -1405,7 +1400,7 @@ class TransportPCEFulltesting(unittest.TestCase):
             time.sleep(5)
 
         for i in range(1, 6):
-            print("trial number {}".format(i))
+            print("iteration number {}".format(i))
             print("oc service creation")
             self.test_36_create_oc_service1()
             print("check xc in ROADM-A1")
index f52325bfe636f344eae9b41ad7761830f6b2a910..8c59393a6156764be936ef3167142219b906987e 100644 (file)
 #############################################################################
 
 import unittest
-import requests
 import time
-import subprocess
-import signal
 import json
-import os
-import psutil
-import shutil
-from unittest.result import failfast
+#from unittest.result import failfast
+import requests
 from common import test_utils
 
 
index 6b72ede018d2b7c99801ee97e56b4ad3b9cf4206..6157b038adc82e54552fb15c618f866b95a1f7bd 100644 (file)
@@ -9,16 +9,10 @@
 # http://www.apache.org/licenses/LICENSE-2.0
 ##############################################################################
 
+import unittest
 import json
-import os
-import psutil
-import requests
-import signal
-import shutil
-import subprocess
 import time
-import unittest
-import logging
+import requests
 from common import test_utils
 
 
index 1be82ab6977378ec151bf4c5df87b73bcb7b4a59..97b6d4e9234fc832b872cccdf7fbf670577d4f10 100644 (file)
@@ -9,16 +9,10 @@
 # http://www.apache.org/licenses/LICENSE-2.0
 ##############################################################################
 
-import json
-import os
-import psutil
-import requests
-import signal
-import shutil
-import subprocess
-import time
 import unittest
+import time
 import logging
+import requests
 from common import test_utils
 
 
index 68d59d5434068f6a15db22ed31a0a072b536491e..551bae62e306a6132d21ca47016a252762071852 100644 (file)
@@ -9,15 +9,9 @@
 # http://www.apache.org/licenses/LICENSE-2.0
 ##############################################################################
 
-import json
-import os
-import psutil
-import requests
-import signal
-import shutil
-import subprocess
-import time
 import unittest
+import time
+import requests
 from common import test_utils
 
 
index 9134fb92d74924550df4592558c10e6c9c345da1..29f4556e7b93bb483aadbdfdde66548b3894ed49 100644 (file)
 #############################################################################
 
 import unittest
-import requests
-import time
-import subprocess
-import signal
 import json
-import os
-import psutil
-import shutil
-from unittest.result import failfast
+#from unittest.result import failfast
+import requests
 from common import test_utils
 
 
@@ -422,9 +416,10 @@ class TransportPCERendererTesting(unittest.TestCase):
             "GET", url, headers=headers, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
         self.assertEqual(response.status_code, requests.codes.not_found)
         res = response.json()
-        self.assertIn(
-            {"error-type": "application", "error-tag": "data-missing",
-                "error-message": "Request could not be completed because the relevant data model content does not exist"},
+        self.assertIn({
+            "error-type": "application",
+            "error-tag": "data-missing",
+            "error-message": "Request could not be completed because the relevant data model content does not exist"},
             res['errors']['error'])
 
     def test_21_service_path_delete_rdm_check(self):
@@ -437,9 +432,10 @@ class TransportPCERendererTesting(unittest.TestCase):
             "GET", url, headers=headers, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
         self.assertEqual(response.status_code, requests.codes.not_found)
         res = response.json()
-        self.assertIn(
-            {"error-type": "application", "error-tag": "data-missing",
-                "error-message": "Request could not be completed because the relevant data model content does not exist"},
+        self.assertIn({
+            "error-type": "application",
+            "error-tag": "data-missing",
+            "error-message": "Request could not be completed because the relevant data model content does not exist"},
             res['errors']['error'])
 
     def test_22_service_path_delete_rdm_check(self):
@@ -452,9 +448,10 @@ class TransportPCERendererTesting(unittest.TestCase):
             "GET", url, headers=headers, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
         self.assertEqual(response.status_code, requests.codes.not_found)
         res = response.json()
-        self.assertIn(
-            {"error-type": "application", "error-tag": "data-missing",
-                "error-message": "Request could not be completed because the relevant data model content does not exist"},
+        self.assertIn({
+            "error-type": "application",
+            "error-tag": "data-missing",
+            "error-message": "Request could not be completed because the relevant data model content does not exist"},
             res['errors']['error'])
 
     def test_23_service_path_delete_xpdr_check(self):
@@ -467,9 +464,10 @@ class TransportPCERendererTesting(unittest.TestCase):
             "GET", url, headers=headers, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
         self.assertEqual(response.status_code, requests.codes.not_found)
         res = response.json()
-        self.assertIn(
-            {"error-type": "application", "error-tag": "data-missing",
-                "error-message": "Request could not be completed because the relevant data model content does not exist"},
+        self.assertIn({
+            "error-type": "application",
+            "error-tag": "data-missing",
+            "error-message": "Request could not be completed because the relevant data model content does not exist"},
             res['errors']['error'])
 
     def test_24_service_path_delete_xpdr_check(self):
@@ -482,9 +480,10 @@ class TransportPCERendererTesting(unittest.TestCase):
             "GET", url, headers=headers, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
         self.assertEqual(response.status_code, requests.codes.not_found)
         res = response.json()
-        self.assertIn(
-            {"error-type": "application", "error-tag": "data-missing",
-                "error-message": "Request could not be completed because the relevant data model content does not exist"},
+        self.assertIn({
+            "error-type": "application",
+            "error-tag": "data-missing",
+            "error-message": "Request could not be completed because the relevant data model content does not exist"},
             res['errors']['error'])
 
     def test_25_service_path_delete_xpdr_check(self):
@@ -497,9 +496,10 @@ class TransportPCERendererTesting(unittest.TestCase):
             "GET", url, headers=headers, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
         self.assertEqual(response.status_code, requests.codes.not_found)
         res = response.json()
-        self.assertIn(
-            {"error-type": "application", "error-tag": "data-missing",
-                "error-message": "Request could not be completed because the relevant data model content does not exist"},
+        self.assertIn({
+            "error-type": "application",
+            "error-tag": "data-missing",
+            "error-message": "Request could not be completed because the relevant data model content does not exist"},
             res['errors']['error'])
 
     def test_26_service_path_delete_xpdr_check(self):
@@ -512,9 +512,10 @@ class TransportPCERendererTesting(unittest.TestCase):
             "GET", url, headers=headers, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
         self.assertEqual(response.status_code, requests.codes.not_found)
         res = response.json()
-        self.assertIn(
-            {"error-type": "application", "error-tag": "data-missing",
-                "error-message": "Request could not be completed because the relevant data model content does not exist"},
+        self.assertIn({
+            "error-type": "application",
+            "error-tag": "data-missing",
+            "error-message": "Request could not be completed because the relevant data model content does not exist"},
             res['errors']['error'])
 
     def test_27_service_path_delete_xpdr_check(self):
index e1c67477bd51fd382b0416c8bafece534f2feca0..b5796895cf8ee552542adcf46a8d235030bab796 100644 (file)
@@ -8,7 +8,7 @@
 # http://www.apache.org/licenses/LICENSE-2.0
 ##############################################################################
 import os
-import re
+import sys
 import time
 import unittest
 
@@ -35,15 +35,15 @@ class TransportTapitesting(unittest.TestCase):
             result = test_utils.install_karaf_feature("odl-transportpce-tapi")
             if result.returncode != 0:
                 cls.init_failed = True
-            print("Restarting opendaylight...")
+            print("Restarting OpenDaylight...")
             test_utils.shutdown_process(cls.processes[0])
             cls.processes = test_utils.start_tpce()
             cls.init_failed = not test_utils.wait_until_log_contains(
-                test_utils.karaf_log, test_utils.KARAF_OK_START_MSG, time_to_wait=60)
+                test_utils.KARAF_LOG, test_utils.KARAF_OK_START_MSG, time_to_wait=60)
         if cls.init_failed:
             print("tapi installaiton feature failed...")
             test_utils.shutdown_process(cls.odl_processes[0])
-            exit(2)
+            sys.exit(2)
         cls.processes = test_utils.start_sims(['xpdra', 'roadma', 'roadmc', 'xpdrc', 'spdrav2'])
 
     @classmethod
index 36e52bd0d362c52f78d182aa56f41e92405fe5fa..6fcfa9912e81c53619cf1b6f75ab44dc19d912d6 100644 (file)
@@ -9,16 +9,10 @@
 # http://www.apache.org/licenses/LICENSE-2.0
 ##############################################################################
 
+import unittest
 import json
-import os
-import psutil
-import requests
-import signal
-import shutil
-import subprocess
 import time
-import unittest
-import logging
+import requests
 from common import test_utils
 
 
index 27da88a84278728514ab45da7c4360191186e749..2b0e7b358ecfbaba409d745127b5b43c869917a0 100644 (file)
@@ -9,16 +9,11 @@
 # http://www.apache.org/licenses/LICENSE-2.0
 ##############################################################################
 
-import json
-import os
-import psutil
-import requests
-import signal
-import shutil
-import subprocess
-import time
 import unittest
+import time
+import json
 import logging
+import requests
 from common import test_utils
 
 
index e3af5fe2f1b35d908bcce737716d8569e13bf1f6..7f2cc1d33edd1f6c8a1aaeb46f6577871f4d893e 100644 (file)
@@ -9,6 +9,7 @@
 ##############################################################################
 import json
 import os
+import sys
 import re
 import signal
 import subprocess
@@ -18,9 +19,9 @@ import requests
 
 import simulators
 
-sims = simulators.sims
-honeynode_executable = simulators.honeynode_executable
-samples_directory = simulators.samples_directory
+SIMS = simulators.SIMS
+HONEYNODE_EXECUTABLE = simulators.HONEYNODE_EXECUTABLE
+SAMPLES_DIRECTORY = simulators.SAMPLES_DIRECTORY
 
 HONEYNODE_OK_START_MSG = "Netconf SSH endpoint started successfully at 0.0.0.0"
 KARAF_OK_START_MSG = re.escape(
@@ -39,24 +40,25 @@ TYPE_APPLICATION_XML = {'Content-Type': 'application/xml', 'Accept': 'applicatio
 CODE_SHOULD_BE_200 = 'Http status code should be 200'
 CODE_SHOULD_BE_201 = 'Http status code should be 201'
 
-log_directory = os.path.dirname(os.path.realpath(__file__))
+LOG_DIRECTORY = os.path.dirname(os.path.realpath(__file__))
 
-karaf_log = os.path.join(
+KARAF_LOG = os.path.join(
     os.path.dirname(os.path.realpath(__file__)),
     "..", "..", "..", "karaf", "target", "assembly", "data", "log", "karaf.log")
 
 process_list = []
 
 if "USE_LIGHTY" in os.environ and os.environ['USE_LIGHTY'] == 'True':
-    tpce_log = 'odl.log'
+    TPCE_LOG = 'odl.log'
 else:
-    tpce_log = karaf_log
+    TPCE_LOG = KARAF_LOG
+
 
 def start_sims(sims_list):
     for sim in sims_list:
         print("starting simulator for " + sim + "...")
-        log_file = os.path.join(log_directory, sims[sim]['logfile'])
-        process = start_honeynode(log_file, sims[sim]['port'], sims[sim]['configfile'])
+        log_file = os.path.join(LOG_DIRECTORY, SIMS[sim]['logfile'])
+        process = start_honeynode(log_file, SIMS[sim]['port'], SIMS[sim]['configfile'])
         if wait_until_log_contains(log_file, HONEYNODE_OK_START_MSG, 100):
             print("simulator for " + sim + " started")
         else:
@@ -64,7 +66,7 @@ def start_sims(sims_list):
             shutdown_process(process)
             for pid in process_list:
                 shutdown_process(pid)
-            exit(3)
+            sys.exit(3)
         process_list.append(process)
     return process_list
 
@@ -76,14 +78,14 @@ def start_tpce():
         # TODO: add some sort of health check similar to Karaf below
     else:
         process = start_karaf()
-        if wait_until_log_contains(karaf_log, KARAF_OK_START_MSG, time_to_wait=60):
+        if wait_until_log_contains(KARAF_LOG, KARAF_OK_START_MSG, time_to_wait=60):
             print("OpenDaylight started !")
         else:
             print("OpenDaylight failed to start !")
             shutdown_process(process)
             for pid in process_list:
                 shutdown_process(pid)
-            exit(1)
+            sys.exit(1)
     process_list.append(process)
     return process_list
 
@@ -145,11 +147,11 @@ def mount_device(node_id, sim):
         "netconf-node-topology:username": NODES_LOGIN,
         "netconf-node-topology:password": NODES_PWD,
         "netconf-node-topology:host": "127.0.0.1",
-        "netconf-node-topology:port": sims[sim]['port'],
+        "netconf-node-topology:port": SIMS[sim]['port'],
         "netconf-node-topology:tcp-only": "false",
         "netconf-node-topology:pass-through": {}}]}
     response = put_request(url, headers, ODL_LOGIN, ODL_PWD)
-    if wait_until_log_contains(tpce_log, re.escape("Triggering notification stream NETCONF for node "+node_id), 60):
+    if wait_until_log_contains(TPCE_LOG, re.escape("Triggering notification stream NETCONF for node "+node_id), 60):
         print("Node "+node_id+" correctly added to tpce topology", end='... ', flush=True)
     else:
         print("Node "+node_id+" still not added to tpce topology", end='... ', flush=True)
@@ -163,7 +165,7 @@ def unmount_device(node_id):
     url = ("{}/config/network-topology:network-topology/topology/topology-netconf/node/"
            + node_id).format(RESTCONF_BASE_URL)
     response = delete_request(url, ODL_LOGIN, ODL_PWD)
-    if wait_until_log_contains(tpce_log, re.escape("onDeviceDisConnected: "+node_id), 60):
+    if wait_until_log_contains(TPCE_LOG, re.escape("onDeviceDisConnected: "+node_id), 60):
         print("Node "+node_id+" correctly deleted from tpce topology", end='... ', flush=True)
     else:
         print("Node "+node_id+" still not deleted from tpce topology", end='... ', flush=True)
@@ -196,10 +198,10 @@ def shutdown_process(process):
 
 
 def start_honeynode(log_file: str, node_port: str, node_config_file_name: str):
-    if os.path.isfile(honeynode_executable):
+    if os.path.isfile(HONEYNODE_EXECUTABLE):
         with open(log_file, 'w') as outfile:
             return subprocess.Popen(
-                [honeynode_executable, node_port, os.path.join(samples_directory, node_config_file_name)],
+                [HONEYNODE_EXECUTABLE, node_port, os.path.join(SAMPLES_DIRECTORY, node_config_file_name)],
                 stdout=outfile, stderr=outfile)
 
 
@@ -207,7 +209,7 @@ def wait_until_log_contains(log_file, regexp, time_to_wait=20):
     found = False
     tail = None
     try:
-        with timeout(seconds=time_to_wait):
+        with TimeOut(seconds=time_to_wait):
             print("Searching for pattern '"+regexp+"' in "+os.path.basename(log_file), end='... ', flush=True)
             tail = subprocess.Popen(['tail', '-F', log_file], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
             compiled_regexp = re.compile(regexp)
@@ -230,7 +232,7 @@ def wait_until_log_contains(log_file, regexp, time_to_wait=20):
 # TODO try to find an alternative to subprocess+tail -f (such as https://pypi.org/project/tailhead/)
 
 
-class timeout:
+class TimeOut:
     def __init__(self, seconds=1, error_message='Timeout'):
         self.seconds = seconds
         self.error_message = error_message