diff options
author | Michael Abel <info@abel-ikt.de> | 2022-04-06 15:31:56 +0200 |
---|---|---|
committer | Michael Abel <info@abel-ikt.de> | 2022-04-06 15:31:56 +0200 |
commit | bc6a3845880191de785e199fc0117918e718e577 (patch) | |
tree | bbee6dfabe657a232e47fff50fc91752b2c78147 /tests | |
parent | b54b8cd5c9f5745b842c2703a65c801dd06c5b9d (diff) |
Autoformat all python files with black
Command: black .
Diffstat (limited to 'tests')
78 files changed, 1026 insertions, 607 deletions
diff --git a/tests/PySys/cloud_c8y/c8y_jwt_token_retrieval/run.py b/tests/PySys/cloud_c8y/c8y_jwt_token_retrieval/run.py index 923dad18..63c83548 100644 --- a/tests/PySys/cloud_c8y/c8y_jwt_token_retrieval/run.py +++ b/tests/PySys/cloud_c8y/c8y_jwt_token_retrieval/run.py @@ -37,16 +37,16 @@ class ValidateJWTTokenRetrieval(TedgeEnvironment): stdouterr="resp_jwt", background=True, ) - + # Publish an empty message on jwt token request topic req_jwt_token = self.startProcess( command=self.sudo, arguments=[self.tedge, "mqtt", "pub", "c8y/s/uat", "''"], - stdouterr="req_jwt", + stdouterr="req_jwt", ) - + time.sleep(1) - + # Kill the subscriber process explicitly with sudo as PySys does # not have the rights to do it kill = self.startProcess( @@ -62,4 +62,3 @@ class ValidateJWTTokenRetrieval(TedgeEnvironment): def jwt_token_cleanup(self): # disconnect the test self.tedge_disconnect_c8y() - diff --git a/tests/PySys/environments/environment_az.py b/tests/PySys/environments/environment_az.py index ed2461ed..ccdc295d 100644 --- a/tests/PySys/environments/environment_az.py +++ b/tests/PySys/environments/environment_az.py @@ -26,10 +26,9 @@ class EnvironmentAz(BaseTest): command=self.systemctl, arguments=["status", self.tedge_mapper_az], stdouterr="serv_mapper1", - expectedExitStatus="==3", # 3: disabled + expectedExitStatus="==3", # 3: disabled ) - # Connect the bridge connect = self.startProcess( command=self.sudo, diff --git a/tests/PySys/environments/environment_c8y.py b/tests/PySys/environments/environment_c8y.py index 57b4a801..f709b80e 100644 --- a/tests/PySys/environments/environment_c8y.py +++ b/tests/PySys/environments/environment_c8y.py @@ -15,6 +15,7 @@ from environment_tedge import TedgeEnvironment Environment to manage automated connects and disconnects to c8y """ + class EnvironmentC8y(TedgeEnvironment): """ Pysys Environment to manage automated connect and disconnect to c8y @@ -31,19 +32,28 @@ class EnvironmentC8y(TedgeEnvironment): super().setup() if self.project.c8yurl == "": self.abort( - FAILED, "Cumulocity tenant URL is not set. Set with the env variable C8YURL") + FAILED, + "Cumulocity tenant URL is not set. Set with the env variable C8YURL", + ) if self.project.tenant == "": self.abort( - FAILED, "Cumulocity tenant ID is not set. Set with the env variable C8YTENANT") + FAILED, + "Cumulocity tenant ID is not set. Set with the env variable C8YTENANT", + ) if self.project.c8yusername == "": self.abort( - FAILED, "Cumulocity tenant username is not set. Set with the env variable C8YUSERNAME") + FAILED, + "Cumulocity tenant username is not set. Set with the env variable C8YUSERNAME", + ) if self.project.c8ypass == "": self.abort( - FAILED, "Cumulocity tenant password is not set. Set with the env variable C8YPASS") + FAILED, + "Cumulocity tenant password is not set. Set with the env variable C8YPASS", + ) if self.project.deviceid == "": self.abort( - FAILED, "Device ID is not set. Set with the env variable C8YDEVICEID") + FAILED, "Device ID is not set. Set with the env variable C8YDEVICEID" + ) self.log.info("EnvironmentC8y Setup") self.addCleanupFunction(self.myenvcleanup) @@ -77,7 +87,12 @@ class EnvironmentC8y(TedgeEnvironment): ) self.cumulocity = Cumulocity( - self.project.c8yurl, self.project.tenant, self.project.c8yusername, self.project.c8ypass, self.log) + self.project.c8yurl, + self.project.tenant, + self.project.c8yusername, + self.project.c8ypass, + self.log, + ) def execute(self): self.log.debug("EnvironmentC8y Execute") @@ -112,4 +127,3 @@ class EnvironmentC8y(TedgeEnvironment): stdouterr="serv_mapper5", expectedExitStatus="==3", ) - diff --git a/tests/PySys/environments/environment_roundtrip_c8y.py b/tests/PySys/environments/environment_roundtrip_c8y.py index 78d1e8e0..b96659fd 100644 --- a/tests/PySys/environments/environment_roundtrip_c8y.py +++ b/tests/PySys/environments/environment_roundtrip_c8y.py @@ -46,7 +46,7 @@ class Environment_roundtrip_c8y(EnvironmentC8y): time.sleep(int(self.timeslot)) sub = self.startPython( - environs={"C8YPASS":self.project.c8ypass}, + environs={"C8YPASS": self.project.c8ypass}, arguments=[ self.cmd, "-m", @@ -79,4 +79,3 @@ class Environment_roundtrip_c8y(EnvironmentC8y): def myenvroundtripcleanup(self): self.log.debug("C8y Roundtrip MyCleanup") - diff --git a/tests/PySys/local_mqtt/local_mqtt_pub_fail_noqos/run.py b/tests/PySys/local_mqtt/local_mqtt_pub_fail_noqos/run.py index 16e9d33c..5bd76d54 100644 --- a/tests/PySys/local_mqtt/local_mqtt_pub_fail_noqos/run.py +++ b/tests/PySys/local_mqtt/local_mqtt_pub_fail_noqos/run.py @@ -17,7 +17,7 @@ class PySysTest(BaseTest): self.tedge = "/usr/bin/tedge" self.sudo = "/usr/bin/sudo" self.systemctl = "/usr/bin/systemctl" - self.environ = { 'HOME':os.environ.get('HOME')} + self.environ = {"HOME": os.environ.get("HOME")} self.startProcess( command=self.sudo, @@ -34,7 +34,7 @@ class PySysTest(BaseTest): arguments=[self.tedge, "mqtt", "pub", "atopic", "amessage"], stdouterr="tedge_pub_fail", expectedExitStatus="==1", - environs=self.environ + environs=self.environ, ) # validate exit status with the expected status from calling startProcess diff --git a/tests/PySys/local_mqtt/local_mqtt_pub_fail_qos0/run.py b/tests/PySys/local_mqtt/local_mqtt_pub_fail_qos0/run.py index ca0f8273..4af53c0a 100644 --- a/tests/PySys/local_mqtt/local_mqtt_pub_fail_qos0/run.py +++ b/tests/PySys/local_mqtt/local_mqtt_pub_fail_qos0/run.py @@ -17,7 +17,7 @@ class PySysTest(BaseTest): self.tedge = "/usr/bin/tedge" self.sudo = "/usr/bin/sudo" self.systemctl = "/usr/bin/systemctl" - self.environ = { 'HOME':os.environ.get('HOME')} + self.environ = {"HOME": os.environ.get("HOME")} self.startProcess( command=self.sudo, @@ -34,7 +34,7 @@ class PySysTest(BaseTest): arguments=["mqtt", "pub", "--qos", "0", "atopic", "amessage"], stdouterr="tedge_pub_fail", expectedExitStatus="==1", - environs=self.environ + environs=self.environ, ) # validate exit status with the expected status from calling startProcess diff --git a/tests/PySys/local_mqtt/local_mqtt_pub_fail_qos1/run.py b/tests/PySys/local_mqtt/local_mqtt_pub_fail_qos1/run.py index 4bd9c8ad..48d095b4 100644 --- a/tests/PySys/local_mqtt/local_mqtt_pub_fail_qos1/run.py +++ b/tests/PySys/local_mqtt/local_mqtt_pub_fail_qos1/run.py @@ -17,7 +17,7 @@ class PySysTest(BaseTest): self.tedge = "/usr/bin/tedge" self.sudo = "/usr/bin/sudo" self.systemctl = "/usr/bin/systemctl" - self.environ = { 'HOME':os.environ.get('HOME')} + self.environ = {"HOME": os.environ.get("HOME")} self.startProcess( command=self.sudo, diff --git a/tests/PySys/local_mqtt/local_mqtt_pub_fail_qos2/run.py b/tests/PySys/local_mqtt/local_mqtt_pub_fail_qos2/run.py index 3f76cedd..b249eaaa 100644 --- a/tests/PySys/local_mqtt/local_mqtt_pub_fail_qos2/run.py +++ b/tests/PySys/local_mqtt/local_mqtt_pub_fail_qos2/run.py @@ -17,7 +17,7 @@ class PySysTest(BaseTest): self.tedge = "/usr/bin/tedge" self.sudo = "/usr/bin/sudo" self.systemctl = "/usr/bin/systemctl" - self.environ = { 'HOME':os.environ.get('HOME')} + self.environ = {"HOME": os.environ.get("HOME")} self.startProcess( command=self.sudo, @@ -34,7 +34,7 @@ class PySysTest(BaseTest): arguments=["mqtt", "pub", "--qos", "2", "atopic", "amessage"], stdouterr="tedge_pub_fail", expectedExitStatus="==1", - environs=self.environ + environs=self.environ, ) |