diff --git a/test/test_device.py b/test/test_device.py index 4e1f13a..642ce89 100644 --- a/test/test_device.py +++ b/test/test_device.py @@ -112,10 +112,20 @@ class TestDeviceConnect(DeviceTestCase): gmxp_res = process_commands(['-f', self.fingerprint, '-p', self.password, 'getmasterxpub']) self.assertEqual(gmxp_res['xpub'], self.master_xpub) - def test_type_only_autodetech(self): + # Nonexistent fingerprint + gmxp_res = process_commands(['-f', '0000ffff', '-p', self.password, 'getmasterxpub']) + self.assertEqual(gmxp_res['error'], 'Could not find device with specified fingerprint') + self.assertEqual(gmxp_res['code'], -3) + + def test_type_only_autodetect(self): gmxp_res = process_commands(['-t', self.type, '-p', self.password, 'getmasterxpub']) self.assertEqual(gmxp_res['xpub'], self.master_xpub) + # Unknown device type + gmxp_res = process_commands(['-t', 'fakedev', '-d', 'fakepath', 'getmasterxpub']) + self.assertEqual(gmxp_res['error'], 'Unknown device type specified') + self.assertEqual(gmxp_res['code'], -4) + class TestGetKeypool(DeviceTestCase): def setUp(self): self.rpc = AuthServiceProxy('http://{}@127.0.0.1:18443'.format(self.rpc_userpass))