Esempio n. 1
0
    def test_lock_from_fixture(self, mock):
        lock_id = 1234
        mock.register_uri(
            "put", API_LOCK_URL.format(lock_id=lock_id), text=load_fixture("lock.json")
        )

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

        self.assertEqual(LockStatus.LOCKED, status)
Esempio n. 2
0
    def test_lock(self, mock):
        lock_id = 1234
        mock.register_uri("put",
                          API_LOCK_URL.format(lock_id=lock_id),
                          text="{\"status\":\"locked\","
                          "\"dateTime\":\"2017-12-10T07:43:39.056Z\","
                          "\"isLockStatusChanged\":false,"
                          "\"valid\":true}")

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

        self.assertEqual(LockStatus.LOCKED, status)
Esempio n. 3
0
    def test_lock(self, mock):
        lock_id = 1234
        mock.register_uri(
            "put",
            API_LOCK_URL.format(lock_id=lock_id),
            text='{"status":"locked",'
            '"dateTime":"2017-12-10T07:43:39.056Z",'
            '"isLockStatusChanged":false,'
            '"valid":true}',
        )

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

        self.assertEqual(LockStatus.LOCKED, status)