Example #1
0
    def test_add_and_remove_internet_password(self):
        import uuid
        k = Keychain()
        kwargs = {
            'server_name': "pymacadmin.googlecode.com",
            'account_name': "unittest",
            'protocol_type': 'http',
            'authentication_type': 'http',
            'password': str(uuid.uuid4())
        }

        i = InternetPassword(**kwargs)
        k.add(i)

        self.assertEquals(
            i.password,
            k.find_internet_password(
                server_name=kwargs['server_name'],
                account_name=kwargs['account_name']).password)

        k.remove(i)
        self.assertRaises(
            KeyError, k.find_internet_password, **{
                "server_name": kwargs['server_name'],
                "account_name": kwargs['account_name']
            })
    def test_add_and_remove_internet_password(self):
        import uuid

        k = Keychain()
        kwargs = {
            "server_name": "pymacadmin.googlecode.com",
            "account_name": "unittest",
            "protocol_type": "http",
            "authentication_type": "http",
            "password": str(uuid.uuid4()),
        }

        i = InternetPassword(**kwargs)
        k.add(i)

        self.assertEquals(
            i.password,
            k.find_internet_password(server_name=kwargs["server_name"], account_name=kwargs["account_name"]).password,
        )

        k.remove(i)
        self.assertRaises(
            KeyError,
            k.find_internet_password,
            **{"server_name": kwargs["server_name"], "account_name": kwargs["account_name"]}
        )
    def test_find_internet_password(self):
        keychain = Keychain()
        i = keychain.find_internet_password(
            server_name="connect.apple.com"
        )  # BUG: Most people probably have this - but not everyone?

        self.failIfEqual(i, None)
 def test_find_internet_password(self):
     keychain = Keychain()
     i = keychain.find_internet_password(server_name="connect.apple.com")
     self.failIfEqual(i, None)
Example #5
0
 def test_find_internet_password(self):
     keychain = Keychain()
     i = keychain.find_internet_password(server_name="connect.apple.com")
     self.failIfEqual(i, None)