|
1 | | -# ------------------------------------------------------------------------- |
2 | | -# Copyright (c) Microsoft Corporation. All rights reserved. |
3 | | -# Licensed under the MIT License. See License.txt in the project root for |
4 | | -# license information. |
5 | | -# -------------------------------------------------------------------------- |
6 | | -''' |
7 | | - Adding testing for the download recording async use cases. |
8 | | -''' |
9 | | -from io import BytesIO |
10 | | -import pytest |
11 | | -import utils._test_constants as CONST |
12 | | -from _shared.testcase import CommunicationTestCase |
| 1 | +# # ------------------------------------------------------------------------- |
| 2 | +# # Copyright (c) Microsoft Corporation. All rights reserved. |
| 3 | +# # Licensed under the MIT License. See License.txt in the project root for |
| 4 | +# # license information. |
| 5 | +# # -------------------------------------------------------------------------- |
| 6 | +# ''' |
| 7 | +# Adding testing for the download recording async use cases. |
| 8 | +# ''' |
| 9 | +# from io import BytesIO |
| 10 | +# import pytest |
| 11 | +# import utils._test_constants as CONST |
| 12 | +# from _shared.testcase import CommunicationTestCase |
13 | 13 |
|
14 | | -from azure.communication.callingserver import CallingServerClient |
15 | | -from azure.communication.callingserver._models import ParallelDownloadOptions |
| 14 | +# from azure.communication.callingserver import CallingServerClient |
| 15 | +# from azure.communication.callingserver._models import ParallelDownloadOptions |
16 | 16 |
|
17 | | -class ContentDownloadTests(CommunicationTestCase): |
| 17 | +# class ContentDownloadTests(CommunicationTestCase): |
18 | 18 |
|
19 | | - def setUp(self): |
20 | | - super(ContentDownloadTests, self).setUp() |
21 | | - self._document_id = "0-wus-d3-008713a3abdb3f3ae4904369277244c5" |
22 | | - self._metadata_url = \ |
23 | | - 'https://storage.asm.skype.com/v1/objects/{}/content/acsmetadata'.format(self._document_id) |
24 | | - self._calling_server_client = \ |
25 | | - CallingServerClient.from_connection_string(self.connection_str) |
| 19 | +# def setUp(self): |
| 20 | +# super(ContentDownloadTests, self).setUp() |
| 21 | +# self._document_id = "0-wus-d3-008713a3abdb3f3ae4904369277244c5" |
| 22 | +# self._metadata_url = \ |
| 23 | +# 'https://storage.asm.skype.com/v1/objects/{}/content/acsmetadata'.format(self._document_id) |
| 24 | +# self._calling_server_client = \ |
| 25 | +# CallingServerClient.from_connection_string(self.connection_str) |
26 | 26 |
|
27 | | - @pytest.mark.skipif(CONST.SKIP_CALLINGSERVER_INTERACTION_LIVE_TESTS, reason=CONST.CALLINGSERVER_INTERACTION_LIVE_TESTS_SKIP_REASON) |
28 | | - def test_download_content_to_stream(self): |
29 | | - stream = self._execute_test() |
30 | | - metadata = stream.getvalue() |
31 | | - self._verify_metadata(metadata) |
| 27 | +# @pytest.mark.skipif(CONST.SKIP_CALLINGSERVER_INTERACTION_LIVE_TESTS, reason=CONST.CALLINGSERVER_INTERACTION_LIVE_TESTS_SKIP_REASON) |
| 28 | +# def test_download_content_to_stream(self): |
| 29 | +# stream = self._execute_test() |
| 30 | +# metadata = stream.getvalue() |
| 31 | +# self._verify_metadata(metadata) |
32 | 32 |
|
33 | | - @pytest.mark.skipif(CONST.SKIP_CALLINGSERVER_INTERACTION_LIVE_TESTS, reason=CONST.CALLINGSERVER_INTERACTION_LIVE_TESTS_SKIP_REASON) |
34 | | - def test_download_content_to_stream_on_chunks(self): |
35 | | - stream = self._execute_test(ParallelDownloadOptions(block_size=400)) |
36 | | - metadata = stream.getvalue() |
37 | | - self._verify_metadata(metadata) |
| 33 | +# @pytest.mark.skipif(CONST.SKIP_CALLINGSERVER_INTERACTION_LIVE_TESTS, reason=CONST.CALLINGSERVER_INTERACTION_LIVE_TESTS_SKIP_REASON) |
| 34 | +# def test_download_content_to_stream_on_chunks(self): |
| 35 | +# stream = self._execute_test(ParallelDownloadOptions(block_size=400)) |
| 36 | +# metadata = stream.getvalue() |
| 37 | +# self._verify_metadata(metadata) |
38 | 38 |
|
39 | | - @pytest.mark.skipif(CONST.SKIP_CALLINGSERVER_INTERACTION_LIVE_TESTS, reason=CONST.CALLINGSERVER_INTERACTION_LIVE_TESTS_SKIP_REASON) |
40 | | - def test_download_content_to_stream_on_chunks_parallel(self): |
41 | | - stream = self._execute_test( |
42 | | - ParallelDownloadOptions( |
43 | | - max_concurrency=3, |
44 | | - block_size=400) |
45 | | - ) |
46 | | - metadata = stream.getvalue() |
47 | | - self._verify_metadata(metadata) |
| 39 | +# @pytest.mark.skipif(CONST.SKIP_CALLINGSERVER_INTERACTION_LIVE_TESTS, reason=CONST.CALLINGSERVER_INTERACTION_LIVE_TESTS_SKIP_REASON) |
| 40 | +# def test_download_content_to_stream_on_chunks_parallel(self): |
| 41 | +# stream = self._execute_test( |
| 42 | +# ParallelDownloadOptions( |
| 43 | +# max_concurrency=3, |
| 44 | +# block_size=400) |
| 45 | +# ) |
| 46 | +# metadata = stream.getvalue() |
| 47 | +# self._verify_metadata(metadata) |
48 | 48 |
|
49 | | - @pytest.mark.skipif(CONST.SKIP_CALLINGSERVER_INTERACTION_LIVE_TESTS, reason=CONST.CALLINGSERVER_INTERACTION_LIVE_TESTS_SKIP_REASON) |
50 | | - def test_download_content_to_stream_with_redirection(self): |
51 | | - stream = self._execute_test() |
52 | | - metadata = stream.getvalue() |
53 | | - self._verify_metadata(metadata) |
| 49 | +# @pytest.mark.skipif(CONST.SKIP_CALLINGSERVER_INTERACTION_LIVE_TESTS, reason=CONST.CALLINGSERVER_INTERACTION_LIVE_TESTS_SKIP_REASON) |
| 50 | +# def test_download_content_to_stream_with_redirection(self): |
| 51 | +# stream = self._execute_test() |
| 52 | +# metadata = stream.getvalue() |
| 53 | +# self._verify_metadata(metadata) |
54 | 54 |
|
55 | | - def _execute_test(self, download_options=None): |
56 | | - downloader = self._calling_server_client.download(self._metadata_url, |
57 | | - parallel_download_options=download_options) |
| 55 | +# def _execute_test(self, download_options=None): |
| 56 | +# downloader = self._calling_server_client.download(self._metadata_url, |
| 57 | +# parallel_download_options=download_options) |
58 | 58 |
|
59 | | - stream = BytesIO() |
60 | | - downloader.readinto(stream) |
61 | | - return stream |
| 59 | +# stream = BytesIO() |
| 60 | +# downloader.readinto(stream) |
| 61 | +# return stream |
62 | 62 |
|
63 | | - def _verify_metadata(self, metadata): |
64 | | - self.assertIsNotNone(metadata) |
65 | | - self.assertTrue(metadata.__contains__(bytes(self._document_id, 'utf-8'))) |
| 63 | +# def _verify_metadata(self, metadata): |
| 64 | +# self.assertIsNotNone(metadata) |
| 65 | +# self.assertTrue(metadata.__contains__(bytes(self._document_id, 'utf-8'))) |
0 commit comments