
* Implement correct certificate verification * Add requests to tools/pip-requires * Fix OS_CACERT env var help text * Add info to README * Rework tests to use requests Pinned requests module to < 1.0 as 1.0.2 is now current in pipi as of 17Dec2012. Change-Id: I120d2c12d6f20ebe2fd7182ec8988cc73f623b80
35 lines
911 B
Python
35 lines
911 B
Python
import copy
|
|
import urlparse
|
|
|
|
import requests
|
|
|
|
from tests import utils
|
|
|
|
|
|
class TokenTests(utils.TestCase):
|
|
def setUp(self):
|
|
super(TokenTests, self).setUp()
|
|
self.TEST_REQUEST_HEADERS = {
|
|
'X-Auth-Token': 'aToken',
|
|
'User-Agent': 'python-keystoneclient'}
|
|
self.TEST_POST_HEADERS = {
|
|
'Content-Type': 'application/json',
|
|
'X-Auth-Token': 'aToken',
|
|
'User-Agent': 'python-keystoneclient'}
|
|
|
|
def test_delete(self):
|
|
resp = utils.TestResponse({
|
|
"status_code": 204,
|
|
"text": ""})
|
|
|
|
kwargs = copy.copy(self.TEST_REQUEST_BASE)
|
|
kwargs['headers'] = self.TEST_REQUEST_HEADERS
|
|
requests.request(
|
|
'DELETE',
|
|
urlparse.urljoin(self.TEST_URL, 'v2.0/tokens/1'),
|
|
**kwargs).AndReturn((resp))
|
|
|
|
self.mox.ReplayAll()
|
|
|
|
self.client.tokens.delete(1)
|