Exemplo n.º 1
0
    def test_unlock(self, mock):
        lock_id = 1234
        mock.register_uri("put",
                          API_UNLOCK_URL.format(lock_id=lock_id),
                          text='{"status": "unlocked"}')

        api = Api()
        status = api.unlock(ACCESS_TOKEN, lock_id)

        self.assertEqual(LockStatus.UNLOCKED, status)
Exemplo n.º 2
0
    def test_unlock_from_fixture(self, mock):
        lock_id = 1234
        mock.register_uri(
            "put",
            API_UNLOCK_URL.format(lock_id=lock_id),
            text=load_fixture("unlock.json"),
        )

        api = Api()
        status = api.unlock(ACCESS_TOKEN, lock_id)

        self.assertEqual(LockStatus.UNLOCKED, status)