Revision 5775b7fb snf-pithos-app/pithos/api/test/top_level.py
b/snf-pithos-app/pithos/api/test/top_level.py | ||
---|---|---|
40 | 40 |
|
41 | 41 |
class TopLevel(PithosAPITest): |
42 | 42 |
def test_not_allowed_method(self): |
43 |
r = self.head(self.pithos_path) |
|
43 |
url = join_urls(self.pithos_path, '/') |
|
44 |
r = self.head(url) |
|
44 | 45 |
self.assertEqual(r.status_code, 400) |
45 |
r = self.put(self.pithos_path, data='')
|
|
46 |
r = self.put(url, data='')
|
|
46 | 47 |
self.assertEqual(r.status_code, 400) |
47 |
r = self.post(self.pithos_path, data='')
|
|
48 |
r = self.post(url, data='')
|
|
48 | 49 |
self.assertEqual(r.status_code, 400) |
49 |
r = self.delete(self.pithos_path)
|
|
50 |
r = self.delete(url)
|
|
50 | 51 |
self.assertEqual(r.status_code, 400) |
51 | 52 |
|
52 | 53 |
def test_authenticate(self): |
53 |
r = self.get(self.pithos_path, token=None) |
|
54 |
url = join_urls(self.pithos_path, '/') |
|
55 |
r = self.get(url, token=None) |
|
54 | 56 |
self.assertEqual(r.status_code, 400) |
55 | 57 |
|
56 |
r = self.get(self.pithos_path, token=None, HTTP_X_AUTH_USER=self.user)
|
|
58 |
r = self.get(url, token=None, HTTP_X_AUTH_USER=self.user)
|
|
57 | 59 |
self.assertEqual(r.status_code, 400) |
58 | 60 |
|
59 |
r = self.get(self.pithos_path, token=None, HTTP_X_AUTH_USER=self.user,
|
|
61 |
r = self.get(url, token=None, HTTP_X_AUTH_USER=self.user,
|
|
60 | 62 |
HTTP_X_AUTH_KEY='DummyToken') |
61 | 63 |
self.assertEqual(r.status_code, 204) |
62 | 64 |
self.assertTrue('X-Auth-Token' in r) |
Also available in: Unified diff