|
10 | 10 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
11 | 11 | # See the License for the specific language governing permissions and
|
12 | 12 | # limitations under the License
|
| 13 | +import sys |
13 | 14 | from io import StringIO
|
14 | 15 |
|
15 | 16 | import pytest
|
@@ -217,3 +218,25 @@ def test_no_launch_uuid_print():
|
217 | 218 | client._skip_analytics = True
|
218 | 219 | client.start_launch('Test Launch', timestamp())
|
219 | 220 | assert 'Report Portal Launch UUID: ' not in str_io.getvalue()
|
| 221 | + |
| 222 | + |
| 223 | +@mock.patch('reportportal_client.client.sys.stdout', new_callable=StringIO) |
| 224 | +def test_launch_uuid_print_default_io(mock_stdout): |
| 225 | + client = RPClient(endpoint='http://endpoint', project='project', |
| 226 | + api_key='test', launch_uuid_print=True) |
| 227 | + client.session = mock.Mock() |
| 228 | + client._skip_analytics = True |
| 229 | + client.start_launch('Test Launch', timestamp()) |
| 230 | + |
| 231 | + assert 'Report Portal Launch UUID: ' in mock_stdout.getvalue() |
| 232 | + |
| 233 | + |
| 234 | +@mock.patch('reportportal_client.client.sys.stdout', new_callable=StringIO) |
| 235 | +def test_launch_uuid_print_default_print(mock_stdout): |
| 236 | + client = RPClient(endpoint='http://endpoint', project='project', |
| 237 | + api_key='test') |
| 238 | + client.session = mock.Mock() |
| 239 | + client._skip_analytics = True |
| 240 | + client.start_launch('Test Launch', timestamp()) |
| 241 | + |
| 242 | + assert 'Report Portal Launch UUID: ' not in mock_stdout.getvalue() |
0 commit comments