Revision 46775
Added by Sandro La Bruzzo about 7 years ago
test_scholix_controller.py | ||
---|---|---|
2 | 2 |
|
3 | 3 |
from __future__ import absolute_import |
4 | 4 |
|
5 |
from swagger_server.models.ds_type import DSType |
|
6 | 5 |
from swagger_server.models.error import Error |
7 | 6 |
from swagger_server.models.scholix import Scholix |
8 | 7 |
from . import BaseTestCase |
... | ... | |
13 | 12 |
class TestScholixController(BaseTestCase): |
14 | 13 |
""" ScholixController integration test stubs """ |
15 | 14 |
|
16 |
def test_realtion_from_datasource_get(self):
|
|
15 |
def test_links_from_datasource_get(self):
|
|
17 | 16 |
""" |
18 |
Test case for realtion_from_datasource_get
|
|
17 |
Test case for links_from_datasource_get
|
|
19 | 18 |
|
20 | 19 |
Get all scholix relation collected from a datasource |
21 | 20 |
""" |
22 | 21 |
query_string = [('datasource', 'datasource_example'), |
23 | 22 |
('page', 56)] |
24 |
response = self.client.open('/v1/realtionFromDatasource',
|
|
23 |
response = self.client.open('/v1/linksFromDatasource',
|
|
25 | 24 |
method='GET', |
26 | 25 |
query_string=query_string) |
27 | 26 |
self.assert200(response, "Response body is : " + response.data.decode('utf-8')) |
28 | 27 |
|
29 |
def test_realtion_to_pid_get(self):
|
|
28 |
def test_links_from_pid_get(self):
|
|
30 | 29 |
""" |
31 |
Test case for realtion_to_pid_get
|
|
30 |
Test case for links_from_pid_get
|
|
32 | 31 |
|
33 |
Try to resolve a Persistent identifier
|
|
32 |
Retrieve all scholix links from a persistent identifier
|
|
34 | 33 |
""" |
35 | 34 |
query_string = [('pid', 'pid_example'), |
36 | 35 |
('pidType', 'pidType_example'), |
36 |
('typologyTarget', 'typologyTarget_example'), |
|
37 |
('datasourceTarget', 'datasourceTarget_example'), |
|
37 | 38 |
('page', 56)] |
38 |
response = self.client.open('/v1/realtionToPid',
|
|
39 |
response = self.client.open('/v1/linksFromPid',
|
|
39 | 40 |
method='GET', |
40 | 41 |
query_string=query_string) |
41 | 42 |
self.assert200(response, "Response body is : " + response.data.decode('utf-8')) |
42 | 43 |
|
43 |
def test_realtion_to_typology_get(self): |
|
44 |
""" |
|
45 |
Test case for realtion_to_typology_get |
|
46 | 44 |
|
47 |
list of all scholix related to a particular typology |
|
48 |
""" |
|
49 |
query_string = [('typology', 'typology_example'), |
|
50 |
('page', 56)] |
|
51 |
response = self.client.open('/v1/realtionToTypology', |
|
52 |
method='GET', |
|
53 |
query_string=query_string) |
|
54 |
self.assert200(response, "Response body is : " + response.data.decode('utf-8')) |
|
55 |
|
|
56 |
|
|
57 | 45 |
if __name__ == '__main__': |
58 | 46 |
import unittest |
59 | 47 |
unittest.main() |
Also available in: Unified diff
uploaded a new version of dli_api