コード例 #1
0
ファイル: keychain_spec.py プロジェクト: clofresh/blimey
    def it_changes_password(self, data_source):
        data_source.authenticate.return_value = None
        data_source.set_password.return_value = None

        keychain = Keychain(data_source)
        keychain.unlock("password")
        keychain.set_password("foobar")

        data_source.set_password.assert_called_with("foobar")
コード例 #2
0
ファイル: keychain_spec.py プロジェクト: NeilBryant/blimey
    def it_changes_password(self, data_source):
        data_source.authenticate.return_value = None
        data_source.set_password.return_value = None

        keychain = Keychain(data_source)
        keychain.unlock("password")
        keychain.set_password("foobar")

        data_source.set_password.assert_called_with("foobar")
コード例 #3
0
ファイル: keychain_spec.py プロジェクト: NeilBryant/blimey
    def it_unlocks_the_keychain_with_the_right_password(self, data_source):
        keychain = Keychain(data_source)
        keychain.unlock('rightpassword')

        data_source.authenticate.assert_called_with('rightpassword')
コード例 #4
0
ファイル: keychain_spec.py プロジェクト: NeilBryant/blimey
    def it_throws_if_unlocking_uninitialized_keychain(self, data_source):
        data_source.is_initialised.return_value = False
        keychain = Keychain(data_source)

        keychain.unlock("somepassword")
コード例 #5
0
ファイル: keychain_spec.py プロジェクト: NeilBryant/blimey
    def it_throws_if_unlocking_with_incorrect_password(self, data_source):
        data_source.authenticate.side_effect = IncorrectPasswordException

        keychain = Keychain(data_source)
        keychain.unlock("wrongpassword")
コード例 #6
0
ファイル: keychain_spec.py プロジェクト: clofresh/blimey
    def it_throws_if_unlocking_with_incorrect_password(self, data_source):
        data_source.authenticate.side_effect = IncorrectPasswordException

        keychain = Keychain(data_source)
        keychain.unlock("wrongpassword")
コード例 #7
0
ファイル: keychain_spec.py プロジェクト: clofresh/blimey
    def it_unlocks_the_keychain_with_the_right_password(self, data_source):
        keychain = Keychain(data_source)
        keychain.unlock('rightpassword')

        data_source.authenticate.assert_called_with('rightpassword')
コード例 #8
0
ファイル: keychain_spec.py プロジェクト: clofresh/blimey
    def it_throws_if_unlocking_uninitialized_keychain(self, data_source):
        data_source.is_initialised.return_value = False
        keychain = Keychain(data_source)

        keychain.unlock("somepassword")