Tests for nonexistent fingerprints and device types

This commit is contained in:
Andrew Chow 2019-02-04 17:47:41 -05:00
parent cd0c994d6d
commit a7d0121c7b

View File

@ -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))