|
1 |
| -""" |
2 |
| -This module contains functional for Base RP items management. |
3 |
| -
|
4 |
| -Copyright (c) 2018 http://reportportal.io . |
5 |
| -
|
6 |
| -Licensed under the Apache License, Version 2.0 (the "License"); |
7 |
| -you may not use this file except in compliance with the License. |
8 |
| -You may obtain a copy of the License at |
9 |
| -
|
10 |
| -http://www.apache.org/licenses/LICENSE-2.0 |
11 |
| -
|
12 |
| -Unless required by applicable law or agreed to in writing, software |
13 |
| -distributed under the License is distributed on an "AS IS" BASIS, |
14 |
| -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
15 |
| -See the License for the specific language governing permissions and |
16 |
| -limitations under the License. |
17 |
| -""" |
| 1 | +"""This module contains functional for Base RP items management.""" |
| 2 | + |
| 3 | +# Copyright (c) 2023 EPAM Systems |
| 4 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +# you may not use this file except in compliance with the License. |
| 6 | +# You may obtain a copy of the License at |
| 7 | +# |
| 8 | +# https://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +# |
| 10 | +# Unless required by applicable law or agreed to in writing, software |
| 11 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +# See the License for the specific language governing permissions and |
| 14 | +# limitations under the License |
18 | 15 |
|
19 | 16 | from reportportal_client.core.rp_requests import HttpRequest
|
20 |
| -from reportportal_client.core.rp_responses import RPResponse |
21 |
| -from reportportal_client.static.defines import NOT_FOUND |
22 | 17 |
|
23 | 18 |
|
24 | 19 | class BaseRPItem(object):
|
@@ -52,34 +47,6 @@ def http_request(self):
|
52 | 47 | """
|
53 | 48 | return self.http_requests[-1] if self.http_requests else None
|
54 | 49 |
|
55 |
| - @property |
56 |
| - def response(self): |
57 |
| - """Get last http response. |
58 |
| -
|
59 |
| - :return: Response data object |
60 |
| - """ |
61 |
| - return self.responses[-1] if self.responses else None |
62 |
| - |
63 |
| - @response.setter |
64 |
| - def response(self, data): |
65 |
| - """Set the response object for the test item. |
66 |
| -
|
67 |
| - :param data: Response data object |
68 |
| - """ |
69 |
| - response = RPResponse(data) |
70 |
| - self.responses.append(response) |
71 |
| - self.uuid = response.id if (response.id is |
72 |
| - not NOT_FOUND) else self.uuid |
73 |
| - |
74 |
| - @property |
75 |
| - def unhandled_requests(self): |
76 |
| - """Get list of requests that were not handled. |
77 |
| -
|
78 |
| - :return: list of HttpRequest objects |
79 |
| - """ |
80 |
| - return [request for request in self.http_requests |
81 |
| - if not request.response] |
82 |
| - |
83 | 50 | def add_request(self, endpoint, method, request_class, *args, **kwargs):
|
84 | 51 | """Add new request object.
|
85 | 52 |
|
|
0 commit comments