From e2cb97f2785d02c81d92bace6de9647f5a016ad7 Mon Sep 17 00:00:00 2001 From: Aaron Shaw Date: Sat, 4 Dec 2021 19:52:49 +0000 Subject: [PATCH] fix --- .../processors/test_diagnostics_processor.py | 6 +++--- tests/gatewayconfig/test_gatewayconfig_app.py | 9 +++++---- tests/gatewayconfig/test_gatewayconfig_shared_state.py | 7 +++++-- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/tests/gatewayconfig/processors/test_diagnostics_processor.py b/tests/gatewayconfig/processors/test_diagnostics_processor.py index 33a2758e..9af76d7d 100644 --- a/tests/gatewayconfig/processors/test_diagnostics_processor.py +++ b/tests/gatewayconfig/processors/test_diagnostics_processor.py @@ -13,9 +13,9 @@ def mocked_requests_get(*args, **kwargs): "AN": "acrobatic-neon-caribou", "APPNAME": "Indoor", "BA": "dev-marvin", "BCH": 976046, "BN": "snowy-river", "BSP": 98.337, "BT": True, "BUTTON": 26, "CELLULAR": False, "E0": "00:BD:27:78:06:EF", "ECC": True, "ECCOB": True, "FR": "915", "FRIENDLY": "Nebra Indoor Hotspot Gen 1", "FW": "2021.08.16.1", - "ID": "851af059f032f4708fc6b77d07e9bc15", "LOR": False, "LTE": False, "MAC": "eth0", "MC": "yes", - "MD": "yes", "MH": "959816", "MN": "symmetric", "MR": True, "MS": False, - "OK": "11cdcEkzjvbGRwpNkihsqoM4yCsrw66jCznJkVuJDcyTf5xKJP", "PF": True, + "ID": "851af059f032f4708fc6b77d07e9bc15", "LOR": False, "LTE": False, "MAC": "eth0", "MC": "yes", + "MD": "yes", "MH": "959816", "MN": "symmetric", "MR": True, "MS": False, + "OK": "11cdcEkzjvbGRwpNkihsqoM4yCsrw66jCznJkVuJDcyTf5xKJP", "PF": True, "PK": "11cecEkzjvbGdwpNkihsqoM4yCsrw66jCznJkVuJDcyTf5xKJP", "RE": "US915", "RESET": 38, "RPI": "0000000057a920e3", "SPIBUS": "spidev1.2", "STATUS": 25, "TYPE": "Full", "VA": "NEBHNT-IN1", "W0": "C8:FE:30:FF:F1:72", "last_updated": "21:38 UTC 21 Aug 2021" diff --git a/tests/gatewayconfig/test_gatewayconfig_app.py b/tests/gatewayconfig/test_gatewayconfig_app.py index ec4d67b4..03d07ec3 100644 --- a/tests/gatewayconfig/test_gatewayconfig_app.py +++ b/tests/gatewayconfig/test_gatewayconfig_app.py @@ -30,10 +30,11 @@ class TestGatewayconfigSha(TestCase): @patch('requests.get', response=DIAGNOSTICS_RESPONSE_MOCK) def test_gpio_pins(self, mock_dbus_interface, mock_findadapter, mock_getbus, mock_file, mock_diagnostics): os.environ['BALENA_DEVICE_TYPE'] = 'TEST' - app = GatewayconfigApp('https://11111111111111119f8b0c9b118c415a@o111111.ingest.sentry.io/1111111', - 'BALENA_APP_NAME', 'BALENA_DEVICE_UUID', 'NEBHNT-IN1', 'ETH0_MOCK_USED', - 'WLAN0_MAC_ADDRESS_FILEPATH', 'DIAGNOSTICS_JSON_URL', 'ETHERNET_IS_ONLINE_FILEPATH', - 'FIRMWARE_VERSION') + app = GatewayconfigApp( + 'https://11111111111111119f8b0c9b118c415a@o111111.ingest.sentry.io/1111111', + 'BALENA_APP_NAME', 'BALENA_DEVICE_UUID', 'NEBHNT-IN1', 'ETH0_MOCK_USED', 'WLAN0_MAC_ADDRESS_FILEPATH', + 'DIAGNOSTICS_JSON_URL', 'ETHERNET_IS_ONLINE_FILEPATH', 'FIRMWARE_VERSION' + ) self.assertEqual(app.variant, 'NEBHNT-IN1') self.assertEqual(app.get_button_pin(), 26) diff --git a/tests/gatewayconfig/test_gatewayconfig_shared_state.py b/tests/gatewayconfig/test_gatewayconfig_shared_state.py index c416ec0a..5de125c3 100644 --- a/tests/gatewayconfig/test_gatewayconfig_shared_state.py +++ b/tests/gatewayconfig/test_gatewayconfig_shared_state.py @@ -3,6 +3,7 @@ from gatewayconfig.gatewayconfig_shared_state import GatewayconfigSharedState + class TestGatewayconfigSha(TestCase): def test_init(self): @@ -17,8 +18,10 @@ def test_init(self): def test_to_s(self): shared_state = GatewayconfigSharedState() self.assertEqual(shared_state.to_s(), - '{"wifi_list_cache": [], "should_scan_wifi": false, "should_advertise_bluetooth": true, "is_advertising_bluetooth": false, "are_diagnostics_ok": false, "public_key": "Unavailable"}') - + '{"wifi_list_cache": [], "should_scan_wifi": false, "should_advertise_bluetooth": true, ' + '"is_advertising_bluetooth": false, "are_diagnostics_ok": false, "public_key": "Unavailable"}' + ) + @patch('gatewayconfig.gatewayconfig_shared_state.get_public_keys_rust', return_value={'key': 'foo'}) def test_load_public_key(self, _): shared_state = GatewayconfigSharedState()