def test_get_encrypted_field_dne(self):
     fields = [EncryptedDeviceField('test_name', 'integer', 123),
               EncryptedDeviceField('test2', 'string', 'something')]
     device = Device('test', [], fields, 'type')
     with self.assertRaises(UnknownDeviceField):
         device.get_encrypted_field('invalid')
 def test_get_encrypted_field(self):
     fields = [EncryptedDeviceField('test_name', 'integer', 123),
               EncryptedDeviceField('test2', 'string', 'something')]
     device = Device('test', [], fields, 'type')
     self.assertEqual(device.get_encrypted_field('test_name'), 123)