Skip to content

Commit

Permalink
flake8 fixes
Browse files Browse the repository at this point in the history
Various flake8 fixes.,

flake8 --exit-zero --exclude=izuma_systest_lib/.eggs,scripts-internal --max-line-length=130
./izuma_systest_lib/edge/remote_terminal.py:38:22: E711 comparison to None should be 'if cond is None:'
./tests/test_edge_online.py:35:1: F401 'os' imported but unused
./tests/test_edge_online.py:38:1: F401 'izuma_systest_lib.edge.kaas.Kaas' imported but unused
./tests/test_edge_online.py:39:1: F401 'izuma_systest_lib.edge.kubectl.Kubectl' imported but unused
./tests/test_edge_online.py:40:1: F401 'izuma_systest_lib.tools.execute_with_retry' imported but unused
./tests/test_edge_online.py:59:5: F841 local variable 'EPOCH_BASE_DELTA' is assigned to but never used
./tests/test_edge_online.py:84:1: E302 expected 2 blank lines, found 1
./tests/test_edge_online.py:116:1: E302 expected 2 blank lines, found 1
./tests/test_edge_online.py:144:1: W391 blank line at end of file
./tests/test_websocket_notifications.py:61:1: E302 expected 2 blank lines, found 1
  • Loading branch information
JanneKiiskila committed Oct 20, 2023
1 parent 30c4019 commit 2c60738
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion izuma_systest_lib/edge/remote_terminal.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def __init__(self, api_key, url):
:param url: Remote terminal url
"""
# Create loop explicitly, Python 3.10 warns, 3.11 stops working..
if self.loop == None:
if self.loop is None:
self.loop = asyncio.new_event_loop()
asyncio.set_event_loop(self.loop)
log.debug(f"RemoteTerminal __init__ self.loop created {self.loop}")
Expand Down
8 changes: 2 additions & 6 deletions tests/test_edge_online.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,8 @@
import logging
import time
import pytest
import os
import json

from izuma_systest_lib.edge.kaas import Kaas
from izuma_systest_lib.edge.kubectl import Kubectl
from izuma_systest_lib.tools import execute_with_retry
from izuma_systest_lib.cloud import connect_handler
from izuma_systest_lib.tools import execute_local_command

Expand All @@ -56,7 +52,6 @@ def test_LwM2M_OK(edge, cloud_api, websocket):
:param websocket: websocket for async notifications
"""

EPOCH_BASE_DELTA = 0
resource = '/3/0/13'
payload = {'method': 'GET', 'uri': resource}
resp = connect_handler.send_async_device_and_wait_for_response(cloud_api,
Expand All @@ -81,6 +76,7 @@ def test_LwM2M_OK(edge, cloud_api, websocket):
log.debug("Received /3/0/13 epoch time {epoch_received} 10 s later.")
assert epoch_delta >= 10, f"Epoch time delta {epoch_delta} not >= 10 s."


def test_Kube_is_OK(edge):
"""
Verify if Edge Kubernetes is in Ready -state.
Expand Down Expand Up @@ -113,6 +109,7 @@ def test_Kube_is_OK(edge):
)
assert False, f"ERROR - can't find device ID {edge.device_id} from kubectl get nodes."


def test_Terminal_OK(edge):
"""
Verify if Edge Terminal is responding to echo command.
Expand Down Expand Up @@ -141,4 +138,3 @@ def test_Edge_Online(edge, cloud_api, websocket):
test_LwM2M_OK(edge, cloud_api, websocket)
test_Terminal_OK(edge)
test_Kube_is_OK(edge)

1 change: 1 addition & 0 deletions tests/test_websocket_notifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def test_registration_update_notification(edge, cloud_api, websocket):

assert data, 'Registration update not received from websocket notification channel'


# Add marker - this reboot test is not always that useful, so having the marker
# Allows you to skip it with pytest -m "not reboot_test"
@pytest.mark.reboot_test
Expand Down

0 comments on commit 2c60738

Please sign in to comment.