Пример #1
0
 def test_device_refuses_invalid_nwkKey_value(self):
     with pytest.raises(Exception):
         device.Devices(
             deveui='dead',
             nwkkey=
             'deadbeefddddddddeadbeefeadbeefeadbeefeadbeefeadbeefeadbeefeadbeefeadbeef',  # noqa: E501
             appkey='12345678901112131415161718192021')
Пример #2
0
 def test_device_refuses_invalid_appKey_length(self):
     with pytest.raises(Exception):
         device.Devices(
             deveui='dead',
             nwkkey=
             'deadbeefddddddddeadbeefeadbeefeadbeefeadbeefeadbeefeadbeefeadbeefeadbeefdeadbeefddddddddeadbeefeadbeefeadbeefeadbeefeadbeefeadbeefeadbeefeadbeef',  # noqa: E501
             appkey='00000000000000000000000000000000')
Пример #3
0
 def lora_device(self, lora_connection, requests_mock):
     # Mock the device creation response
     requests_mock.post("https://loraserver/api/devices", json={})
     requests_mock.post(
         "https://loraserver/api/devices/deadbeefdeadbeef/keys", json={})
     from pyloraserver import device
     return device.Devices(loraserver_connection=lora_connection)
Пример #4
0
 def lora_correct_device(self):
     from pyloraserver import device
     return device.Devices(deveui='deadbeefdeadbeef',
                           nwkkey='deadbeefdeadbeefdeadbeefdeadbeef',
                           appkey='00000000000000000000000000000000')
Пример #5
0
 def test_device_list_is_a_dict(self, lora_connection, requests_mock):
     from pyloraserver import device
     d = device.Devices(loraserver_connection=lora_connection)
     devices = d.list_all(appid=1)
     assert type(devices) is dict
Пример #6
0
 def test_connection_setup_with_device_list(self, lora_connection):
     devices = device.Devices(loraserver_connection=lora_connection)
     devices.list_all(limit=10, appid=1)