Пример #1
0
    def it_creates_file_system_and_keys_on_initialisation(self, initialise_file_system, save_key):
        data_source = DataSource('some_path')
        data_source.initialise('password', {'iterations': 2})

        initialise_file_system.assert_called_once_with()

        # I'm sure there's a better way to unpack these...
        first_key = save_key.call_args_list[0][0][0]
        second_key = save_key.call_args_list[1][0][0]

        assert type(first_key) is EncryptedKey
        assert first_key.level == 'SL3'
        assert first_key.iterations == 2

        assert type(second_key) is EncryptedKey
        assert second_key.level == 'SL5'
        assert first_key.iterations == 2
Пример #2
0
    def it_creates_file_system_and_keys_on_initialisation(
            self, initialise_file_system, save_key):
        data_source = DataSource('some_path')
        data_source.initialise('password', {'iterations': 2})

        initialise_file_system.assert_called_once_with()

        # I'm sure there's a better way to unpack these...
        first_key = save_key.call_args_list[0][0][0]
        second_key = save_key.call_args_list[1][0][0]

        assert type(first_key) is EncryptedKey
        assert first_key.level == 'SL3'
        assert first_key.iterations == 2

        assert type(second_key) is EncryptedKey
        assert second_key.level == 'SL5'
        assert first_key.iterations == 2