def test_api_refresh_ok(self): token = None def set_token(val): token = val self._api = _API('a', 'b', refresh_token='d') self._api.set_refresh_notify_callback(lambda t: set_token(t)) yield self._api.refresh() self.assertEquals('o', token) self.assertEquals(token, self._api.token)
def setUp(self, *args, **kwargs): self._api = _API('a', 'b', refresh_token='d') super(TestOdnoklassnikiAPI, self).setUp(*args, **kwargs)