|
19 | 19 | import json
|
20 | 20 | import pytest
|
21 | 21 | import responses
|
22 |
| -from ibm_cloud_networking_services.zones_settings_v1 import ZonesSettingsV1 |
| 22 | +from ibm_cloud.zones_settings_v1 import * |
23 | 23 |
|
24 | 24 | crn = 'testString'
|
25 | 25 | zone_identifier = 'testString'
|
@@ -1475,7 +1475,6 @@ def test_update_minify_all_params(self):
|
1475 | 1475 | html=html,
|
1476 | 1476 | js=js,
|
1477 | 1477 | )
|
1478 |
| - print(response) |
1479 | 1478 | # Check for correct operation
|
1480 | 1479 | assert len(responses.calls) == 1
|
1481 | 1480 | assert response.status_code == 200
|
@@ -3818,3 +3817,138 @@ def test_update_web_application_firewall_required_params(self):
|
3818 | 3817 | # End of Service: UpdateWebApplicationFirewallSetting
|
3819 | 3818 | ##############################################################################
|
3820 | 3819 |
|
| 3820 | +############################################################################## |
| 3821 | +# Start of Service: GetCiphersSetting |
| 3822 | +############################################################################## |
| 3823 | +# region |
| 3824 | + |
| 3825 | +#----------------------------------------------------------------------------- |
| 3826 | +# Test Class for get_ciphers |
| 3827 | +#----------------------------------------------------------------------------- |
| 3828 | +class TestGetCiphers(): |
| 3829 | + |
| 3830 | + #-------------------------------------------------------- |
| 3831 | + # get_ciphers() |
| 3832 | + #-------------------------------------------------------- |
| 3833 | + @responses.activate |
| 3834 | + def test_get_ciphers_all_params(self): |
| 3835 | + # Set up mock |
| 3836 | + url = base_url + '/v1/testString/zones/testString/settings/ciphers' |
| 3837 | + mock_response = '{"result": {"id": "ciphers", "value": [["value"]], "editable": true, "modified_on": "2019-01-01T12:00:00"}, "success": true, "errors": [["errors"]], "messages": [["messages"]]}' |
| 3838 | + responses.add(responses.GET, |
| 3839 | + url, |
| 3840 | + body=mock_response, |
| 3841 | + content_type='*/*', |
| 3842 | + status=200) |
| 3843 | + |
| 3844 | + # Set up parameter values |
| 3845 | + accept = 'testString' |
| 3846 | + |
| 3847 | + # Invoke method |
| 3848 | + response = service.get_ciphers( |
| 3849 | + accept=accept |
| 3850 | + ) |
| 3851 | + |
| 3852 | + # Check for correct operation |
| 3853 | + assert len(responses.calls) == 1 |
| 3854 | + assert response.status_code == 200 |
| 3855 | + |
| 3856 | + |
| 3857 | + #-------------------------------------------------------- |
| 3858 | + # test_get_ciphers_required_params() |
| 3859 | + #-------------------------------------------------------- |
| 3860 | + @responses.activate |
| 3861 | + def test_get_ciphers_required_params(self): |
| 3862 | + # Set up mock |
| 3863 | + url = base_url + '/v1/testString/zones/testString/settings/ciphers' |
| 3864 | + mock_response = '{"result": {"id": "ciphers", "value": [["value"]], "editable": true, "modified_on": "2019-01-01T12:00:00"}, "success": true, "errors": [["errors"]], "messages": [["messages"]]}' |
| 3865 | + responses.add(responses.GET, |
| 3866 | + url, |
| 3867 | + body=mock_response, |
| 3868 | + content_type='*/*', |
| 3869 | + status=200) |
| 3870 | + |
| 3871 | + # Invoke method |
| 3872 | + response = service.get_ciphers() |
| 3873 | + |
| 3874 | + |
| 3875 | + # Check for correct operation |
| 3876 | + assert len(responses.calls) == 1 |
| 3877 | + assert response.status_code == 200 |
| 3878 | + |
| 3879 | + |
| 3880 | +# endregion |
| 3881 | +############################################################################## |
| 3882 | +# End of Service: GetCiphersSetting |
| 3883 | +############################################################################## |
| 3884 | + |
| 3885 | +############################################################################## |
| 3886 | +# Start of Service: UpdateCiphersSetting |
| 3887 | +############################################################################## |
| 3888 | +# region |
| 3889 | + |
| 3890 | +#----------------------------------------------------------------------------- |
| 3891 | +# Test Class for update_ciphers |
| 3892 | +#----------------------------------------------------------------------------- |
| 3893 | +class TestUpdateCiphers(): |
| 3894 | + |
| 3895 | + #-------------------------------------------------------- |
| 3896 | + # update_ciphers() |
| 3897 | + #-------------------------------------------------------- |
| 3898 | + @responses.activate |
| 3899 | + def test_update_ciphers_all_params(self): |
| 3900 | + # Set up mock |
| 3901 | + url = base_url + '/v1/testString/zones/testString/settings/ciphers' |
| 3902 | + mock_response = '{"result": {"id": "ciphers", "value": [["value"]], "editable": true, "modified_on": "2019-01-01T12:00:00"}, "success": true, "errors": [["errors"]], "messages": [["messages"]]}' |
| 3903 | + responses.add(responses.PATCH, |
| 3904 | + url, |
| 3905 | + body=mock_response, |
| 3906 | + content_type='*/*', |
| 3907 | + status=200) |
| 3908 | + |
| 3909 | + # Set up parameter values |
| 3910 | + accept = 'testString' |
| 3911 | + value = [['ECDHE-ECDSA-AES128-GCM-SHA256']] |
| 3912 | + |
| 3913 | + # Invoke method |
| 3914 | + response = service.update_ciphers( |
| 3915 | + accept=accept, |
| 3916 | + value=value, |
| 3917 | + ) |
| 3918 | + |
| 3919 | + # Check for correct operation |
| 3920 | + assert len(responses.calls) == 1 |
| 3921 | + assert response.status_code == 200 |
| 3922 | + # Validate body params |
| 3923 | + req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) |
| 3924 | + assert req_body['value'] == value |
| 3925 | + |
| 3926 | + |
| 3927 | + #-------------------------------------------------------- |
| 3928 | + # test_update_ciphers_required_params() |
| 3929 | + #-------------------------------------------------------- |
| 3930 | + @responses.activate |
| 3931 | + def test_update_ciphers_required_params(self): |
| 3932 | + # Set up mock |
| 3933 | + url = base_url + '/v1/testString/zones/testString/settings/ciphers' |
| 3934 | + mock_response = '{"result": {"id": "ciphers", "value": [["value"]], "editable": true, "modified_on": "2019-01-01T12:00:00"}, "success": true, "errors": [["errors"]], "messages": [["messages"]]}' |
| 3935 | + responses.add(responses.PATCH, |
| 3936 | + url, |
| 3937 | + body=mock_response, |
| 3938 | + content_type='*/*', |
| 3939 | + status=200) |
| 3940 | + |
| 3941 | + # Invoke method |
| 3942 | + response = service.update_ciphers() |
| 3943 | + |
| 3944 | + |
| 3945 | + # Check for correct operation |
| 3946 | + assert len(responses.calls) == 1 |
| 3947 | + assert response.status_code == 200 |
| 3948 | + |
| 3949 | + |
| 3950 | +# endregion |
| 3951 | +############################################################################## |
| 3952 | +# End of Service: UpdateCiphersSetting |
| 3953 | +############################################################################## |
| 3954 | + |
0 commit comments