Esempio n. 1
0
 def test_with_name_case(self, test_device):
     protocol = test_device.protocol
     modem = test_device.modem
     #address is intentionally badly formatted
     device = Base.from_config([{"32 34 56": 'tEst'}], protocol, modem)
     assert device[0].name == 'test'
     assert device[0].name_user_case == 'tEst'
Esempio n. 2
0
 def test_load_config_extra_two_addr(self, test_device, caplog):
     protocol = test_device.protocol
     modem = test_device.modem
     device = Base.from_config([{
         "11.22.33": 'test',
         "aa.bb.cc": 1
     }], protocol, modem)
     assert 'Multiple insteon addresses found in config' in caplog.text
     assert len(device) == 0
Esempio n. 3
0
 def test_load_config_extra_no_addr(self, test_device, caplog):
     protocol = test_device.protocol
     modem = test_device.modem
     device = Base.from_config([{
         "not_addr": 'test',
         "min_hops": 1
     }], protocol, modem)
     assert 'No insteon address found in config' in caplog.text
     assert len(device) == 0
Esempio n. 4
0
 def test_load_config_extra_good(self, test_device, caplog):
     protocol = test_device.protocol
     modem = test_device.modem
     device = Base.from_config([{
         "11.22.33": 'test',
         "min_hops": 1
     }], protocol, modem)
     assert device
     assert device[0].config_extra['min_hops'] == 1
Esempio n. 5
0
 def test_no_name(self, test_device):
     protocol = test_device.protocol
     modem = test_device.modem
     #address is intentionally badly formatted
     device = Base.from_config(["3 2.34:56"], protocol, modem)
     assert device