File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ class Client(object):
2828
2929 __family_path__ = "family"
3030 __images_path__ = "published-data/images"
31+ __legal_path__ = "legal"
3132 __number_path__ = "number-service"
3233 __published_data_path__ = "published-data"
3334 __published_data_search_path__ = "published-data/search"
@@ -119,6 +120,29 @@ def image(
119120 """
120121 return self ._image_request (path , range , document_format )
121122
123+ def legal (
124+ self ,
125+ reference_type : str ,
126+ input : Union [Original , Docdb , Epodoc ],
127+ ) -> requests .Response :
128+ """
129+ Retrieval service for legal data.
130+
131+ Args:
132+ reference_type (str): Any of "publication", "application", or "priority".
133+ input (Epodoc or Docdb): The document number as a Epodoc or Docdb data object.
134+ Returns:
135+ requests.Response: a requests.Response object.
136+
137+ """
138+
139+ return self ._service_request (
140+ dict (
141+ service = self .__legal_path__ ,
142+ reference_type = reference_type ,
143+ input = input ,
144+ )
145+ )
122146 def number (
123147 self ,
124148 reference_type : str ,
Original file line number Diff line number Diff line change @@ -48,6 +48,11 @@ def assert_image_success(client):
4848 assert_request_success (response )
4949 return response
5050
51+ def assert_legal_success (client ):
52+ response = client .legal (* data )
53+ assert_request_success (response )
54+ assert "ops:legal" in response .text
55+ return response
5156
5257def assert_published_data_success (client ):
5358 response = client .published_data (* data )
Original file line number Diff line number Diff line change 1212 assert_family_legal_success ,
1313 assert_family_success ,
1414 assert_image_success ,
15+ assert_legal_success ,
1516 assert_number_service_success ,
1617 assert_published_data_search_success ,
1718 assert_published_data_search_with_range_success ,
@@ -44,6 +45,8 @@ def test_family_legal(all_clients):
4445def test_image (all_clients ):
4546 assert_image_success (all_clients )
4647
48+ def test_legal (all_clients ):
49+ assert_legal_success (all_clients )
4750
4851def test_published_data (all_clients ):
4952 assert_published_data_success (all_clients )
You can’t perform that action at this time.
0 commit comments