Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
shawaj committed Dec 4, 2021
1 parent ac03578 commit e2cb97f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
6 changes: 3 additions & 3 deletions tests/gatewayconfig/processors/test_diagnostics_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
9 changes: 5 additions & 4 deletions tests/gatewayconfig/test_gatewayconfig_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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://[email protected]/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://[email protected]/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)
Expand Down
7 changes: 5 additions & 2 deletions tests/gatewayconfig/test_gatewayconfig_shared_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

from gatewayconfig.gatewayconfig_shared_state import GatewayconfigSharedState


class TestGatewayconfigSha(TestCase):

def test_init(self):
Expand All @@ -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()
Expand Down

0 comments on commit e2cb97f

Please sign in to comment.