Revision 79b5d61b astakosclient/astakosclient/tests.py
b/astakosclient/astakosclient/tests.py | ||
---|---|---|
108 | 108 |
|
109 | 109 |
def _request_ok(conn, method, url, **kwargs): |
110 | 110 |
"""This request behaves like original Astakos does""" |
111 |
if url.startswith("/im/authenticate"):
|
|
111 |
if url.startswith("/astakos/api/authenticate"):
|
|
112 | 112 |
return _req_authenticate(conn, method, url, **kwargs) |
113 |
elif url.startswith("/user_catalogs"): |
|
113 |
elif url.startswith("/astakos/api/user_catalogs"):
|
|
114 | 114 |
return _req_catalogs(conn, method, url, **kwargs) |
115 | 115 |
elif url.startswith("/astakos/api/resources"): |
116 | 116 |
return _req_resources(conn, method, url, **kwargs) |
... | ... | |
472 | 472 |
_mock_request([_request_offline]) |
473 | 473 |
try: |
474 | 474 |
client = AstakosClient("https://example.com", use_pool=pool) |
475 |
client._call_astakos(token_1, "/im/authenticate")
|
|
475 |
client._call_astakos(token_1, "/astakos/api/authenticate")
|
|
476 | 476 |
except AstakosClientException: |
477 | 477 |
pass |
478 | 478 |
else: |
... | ... | |
493 | 493 |
_mock_request([_request_ok]) |
494 | 494 |
try: |
495 | 495 |
client = AstakosClient("https://example.com", use_pool=pool) |
496 |
client._call_astakos(token, "/im/authenticate")
|
|
496 |
client._call_astakos(token, "/astakos/api/authenticate")
|
|
497 | 497 |
except Unauthorized: |
498 | 498 |
pass |
499 | 499 |
except Exception: |
... | ... | |
516 | 516 |
_mock_request([_request_ok]) |
517 | 517 |
try: |
518 | 518 |
client = AstakosClient("https://example.com", use_pool=pool) |
519 |
client._call_astakos(token_1, "/im/misspelled")
|
|
519 |
client._call_astakos(token_1, "/astakos/api/misspelled")
|
|
520 | 520 |
except NotFound: |
521 | 521 |
pass |
522 | 522 |
except Exception: |
... | ... | |
539 | 539 |
_mock_request([_request_ok]) |
540 | 540 |
try: |
541 | 541 |
client = AstakosClient("ftp://example.com", use_pool=pool) |
542 |
client._call_astakos(token_1, "/im/authenticate")
|
|
542 |
client._call_astakos(token_1, "/astakos/api/authenticate")
|
|
543 | 543 |
except BadValue: |
544 | 544 |
pass |
545 | 545 |
except Exception: |
... | ... | |
562 | 562 |
_mock_request([_request_ok]) |
563 | 563 |
try: |
564 | 564 |
client = AstakosClient("http://example.com", use_pool=pool) |
565 |
client._call_astakos(token_1, "/im/authenticate")
|
|
565 |
client._call_astakos(token_1, "/astakos/api/authenticate")
|
|
566 | 566 |
except AstakosClientException as err: |
567 | 567 |
if err.status != 302: |
568 | 568 |
self.fail("Should have returned 302 (Found)") |
... | ... | |
584 | 584 |
_mock_request([_request_ok]) |
585 | 585 |
try: |
586 | 586 |
client = AstakosClient("https://example.com", use_pool=pool) |
587 |
client._call_astakos(token_1, "/im/authenticate", method="POST")
|
|
587 |
client._call_astakos(token_1, "/astakos/api/authenticate", method="POST")
|
|
588 | 588 |
except BadRequest: |
589 | 589 |
pass |
590 | 590 |
except Exception: |
... | ... | |
607 | 607 |
_mock_request([_request_ok]) |
608 | 608 |
try: |
609 | 609 |
client = AstakosClient("https://example.com", use_pool=pool) |
610 |
client._call_astakos(token_1, "/user_catalogs") |
|
610 |
client._call_astakos(token_1, "/astakos/api/user_catalogs")
|
|
611 | 611 |
except BadRequest: |
612 | 612 |
pass |
613 | 613 |
except Exception: |
Also available in: Unified diff