def test_apply_settings_passphrase(self):
        self.setup_mnemonic_pin_nopassphrase()

        assert self.client.features.passphrase_protection is False

        with self.client:
            self.client.set_expected_responses(
                [proto.Success(), proto.Features()])
            self.client.apply_settings(use_passphrase=True)

        assert self.client.features.passphrase_protection is True

        with self.client:
            self.client.set_expected_responses(
                [proto.Success(), proto.Features()])
            self.client.apply_settings(use_passphrase=False)

        assert self.client.features.passphrase_protection is False

        with self.client:
            self.client.set_expected_responses(
                [proto.Success(), proto.Features()])
            self.client.apply_settings(use_passphrase=True)

        assert self.client.features.passphrase_protection is True
 def test_apply_settings(self):
     with self.client:
         self.setup_mnemonic_nopin_passphrase()
         self.client.set_expected_responses(
             [proto.Success(),
              proto.Features()])  # HideezClient reinitializes device
         self.client.apply_settings(label='nazdar')
    def test_apply_settings(self):
        self.setup_mnemonic_pin_passphrase()
        assert self.client.features.label == 'test'

        with self.client:
            self.client.set_expected_responses(
                [proto.Success(), proto.Features()])
            self.client.apply_settings(label='new label')

        assert self.client.features.label == 'new label'
    def test_load_device(self):
        with self.client:
            self.client.set_expected_responses(
                [proto.Success(), proto.Features()])
            self.client.load_device_by_mnemonic('this is mnemonic',
                                                '1234',
                                                True,
                                                'label',
                                                'english',
                                                skip_checksum=True)

        # This must fail, because device is already initialized
        with pytest.raises(Exception):
            self.client.load_device_by_mnemonic('this is mnemonic',
                                                '1234',
                                                True,
                                                'label',
                                                'english',
                                                skip_checksum=True)
 def test_wipe_device(self):
     with self.client:
         self.setup_mnemonic_nopin_passphrase()
         self.client.set_expected_responses(
             [proto.Success(), proto.Features()])
         self.client.wipe_device()
 def test_initialize(self):
     with self.client:
         self.setup_mnemonic_nopin_passphrase()
         self.client.set_expected_responses([proto.Features()])
         self.client.init_device()