コード例 #1
0
 def test_get_api_keys(self, rest_mocker, ms_client, ms_api_schema: dict):
     """Test case for get_api_keys"""
     generate_method_test(ms_client,
                          self.previous_auth_api_spec,
                          "GET",
                          "/auth/api_keys",
                          rest_mocker,
                          mock_request_from_schema=True,
                          mock_response=AccessApiData.ApiKeysResponse)(
                              access_api.get_api_keys)
コード例 #2
0
 def test_get_user_credentials(self, rest_mocker, ms_client, ms_api_schema: dict):
     """Test case for get_user_credentials"""
     generate_method_test(
         ms_client,
         ms_api_schema,
         "GET",
         "/user/credentials",
         rest_mocker,
         mock_request_from_schema=True,
         mock_response=UserApiData.CredsList,
     )(user_api.get_user_credentials)
コード例 #3
0
 def test_delete_backup(self, rest_mocker, ms_client, ms_api_schema: dict):
     """Test case for delete_backup"""
     generate_method_test(
         ms_client,
         ms_api_schema,
         "DELETE",
         "/backups",
         rest_mocker,
         mock_request_from_schema=True,
         mock_response_from_schema=True,
     )(backups_api.delete_backup)
コード例 #4
0
 def test_put_keyset(self, rest_mocker, vns3_client, vns3_api_schema: dict):
     """Test case for put_keyset"""
     generate_method_test(
         vns3_client,
         vns3_api_schema,
         "put",
         "/keyset",
         rest_mocker,
         mock_request_from_schema=True,
         mock_response=ConfigurationApiData.KeysetDetail,
     )(configuration_api.put_keyset)
コード例 #5
0
 def test_get_config(self, rest_mocker, vns3_client, vns3_api_schema: dict):
     """Test case for get_config"""
     generate_method_test(
         vns3_client,
         vns3_api_schema,
         "get",
         "/config",
         rest_mocker,
         mock_request_from_schema=True,
         mock_response=ConfigurationApiData.ConfigDetail,
     )(configuration_api.get_config)
コード例 #6
0
 def test_put_import_snapshot(self, rest_mocker, vns3_client, vns3_api_schema: dict):
     """Test case for put_import_snapshot"""
     generate_method_test(
         vns3_client,
         vns3_api_schema,
         "put",
         "/snapshots/running_config",
         rest_mocker,
         mock_request_from_schema=True,
         mock_response=SnapshotsApiData.SnapshotImportResponse,
     )(snapshots_api.put_import_snapshot)
コード例 #7
0
 def test_get_job_status(self, rest_mocker, ms_client, ms_api_schema: dict):
     """Test case for get_job_status"""
     generate_method_test(
         ms_client,
         ms_api_schema,
         "GET",
         "/system/jobs/{uuid}",
         rest_mocker,
         mock_request_from_schema=True,
         mock_response_from_schema=True,
     )(system_api.get_job_status)
コード例 #8
0
 def test_get_alerts(self, rest_mocker, ms_client, ms_api_schema: dict):
     """Test case for get_alerts"""
     generate_method_test(
         ms_client,
         ms_api_schema,
         "GET",
         "/alerts",
         rest_mocker,
         mock_request_from_schema=True,
         mock_response=CloudMonitoringApiData.AlertListResponse,
     )(cloud_monitoring_api.get_alerts)
コード例 #9
0
 def test_post_create_api_key(self, rest_mocker, ms_client,
                              ms_api_schema: dict):
     """Test case for post_create_api_key"""
     generate_method_test(ms_client,
                          self.previous_auth_api_spec,
                          "POST",
                          "/auth/api_key",
                          rest_mocker,
                          mock_request_from_schema=True,
                          mock_response=AccessApiData.NewApiKeyResponse)(
                              access_api.post_create_api_key)
コード例 #10
0
 def test_put_expire_token(self, rest_mocker, ms_client,
                           ms_api_schema: dict):
     """Test case for put_expire_token"""
     generate_method_test(ms_client,
                          self.previous_auth_api_spec,
                          "PUT",
                          "/auth/expire_token",
                          rest_mocker,
                          mock_request_from_schema=True,
                          mock_response=AccessApiData.ExpireTokenResponse)(
                              access_api.put_expire_token)
コード例 #11
0
 def test_put_invalidate_api_key_tokens(self, rest_mocker, ms_client,
                                        ms_api_schema: dict):
     """Test case for put_invalidate_api_key_tokens"""
     generate_method_test(ms_client,
                          self.previous_auth_api_spec,
                          "PUT",
                          "/auth/invalidate_tokens",
                          rest_mocker,
                          mock_request_from_schema=True,
                          mock_response=AccessApiData.ExpireKeyTokens)(
                              access_api.put_invalidate_api_key_tokens)
コード例 #12
0
 def test_put_activate_api_key(self, rest_mocker, ms_client,
                               ms_api_schema: dict):
     """Test case for put_activate_api_key"""
     generate_method_test(ms_client,
                          self.previous_auth_api_spec,
                          "PUT",
                          "/auth/activate",
                          rest_mocker,
                          mock_request_from_schema=True,
                          mock_response_from_schema=True)(
                              access_api.put_activate_api_key)
コード例 #13
0
 def test_get_alerts(self, rest_mocker, vns3_client, vns3_api_schema: dict):
     """Test case for get_alerts"""
     generate_method_test(
         vns3_client,
         vns3_api_schema,
         "get",
         "/alerts",
         rest_mocker,
         mock_request_from_schema=True,
         mock_response=MonitoringApiData.AlertsListResponse,
     )(monitoring_alerting_api.get_alerts)
コード例 #14
0
 def test_delete_user_credential(self, rest_mocker, ms_client, ms_api_schema: dict):
     """Test case for delete_user_credential"""
     generate_method_test(
         ms_client,
         ms_api_schema,
         "DELETE",
         "/user/credentials/{credential_id}",
         rest_mocker,
         mock_request_from_schema=True,
         mock_response_from_schema=True,
     )(user_api.delete_user_credential)
コード例 #15
0
 def test_get_cloud_vlan(self, rest_mocker, ms_client, ms_api_schema: dict):
     """Test case for get_cloud_vlan"""
     generate_method_test(
         ms_client,
         ms_api_schema,
         "GET",
         "/cloud_vlans/{vlan_id}",
         rest_mocker,
         mock_request_from_schema=True,
         mock_response=CloudMonitoringApiData.CloudVlanDetail,
     )(cloud_monitoring_api.get_cloud_vlan)
コード例 #16
0
 def test_delete_snapshot(self, rest_mocker, vns3_client, vns3_api_schema: dict):
     """Test case for delete_snapshot"""
     generate_method_test(
         vns3_client,
         vns3_api_schema,
         "delete",
         "/snapshots/{snapshot_name}",
         rest_mocker,
         mock_request_from_schema=True,
         mock_response=SnapshotsApiData.SnapshotsListResponse,
     )(snapshots_api.delete_snapshot)
コード例 #17
0
 def test_delete_webhook(self, rest_mocker, ms_client, ms_api_schema: dict):
     """Test case for delete_webhook"""
     generate_method_test(
         ms_client,
         ms_api_schema,
         "DELETE",
         "/webhook/{webhook_id}",
         rest_mocker,
         mock_request_from_schema=True,
         mock_response=CloudMonitoringApiData.WebhookDetail,
     )(cloud_monitoring_api.delete_webhook)
コード例 #18
0
 def test_get_snapshots(self, rest_mocker, vns3_client, vns3_api_schema: dict):
     """Test case for get_snapshots"""
     generate_method_test(
         vns3_client,
         vns3_api_schema,
         "get",
         "/snapshots",
         rest_mocker,
         mock_request_from_schema=True,
         mock_response=SnapshotsApiData.SnapshotsListResponse,
     )(snapshots_api.get_snapshots)
コード例 #19
0
 def test_delete_alert(self, rest_mocker, ms_client, ms_api_schema: dict):
     """Test case for delete_alert"""
     generate_method_test(
         ms_client,
         ms_api_schema,
         "DELETE",
         "/alert/{alert_id}",
         rest_mocker,
         mock_request_from_schema=True,
         mock_response=CloudMonitoringApiData.AlertDetail,
     )(cloud_monitoring_api.delete_alert)
コード例 #20
0
 def test_get_backup_job(self, rest_mocker, ms_client, ms_api_schema: dict):
     """Test case for get_backup_job"""
     generate_method_test(
         ms_client,
         ms_api_schema,
         "GET",
         "/backups/create_backup/{uuid}",
         rest_mocker,
         mock_request_from_schema=True,
         mock_response=BackupsApiData.BackupJobStatusResponse,
     )(backups_api.get_backup_job)
コード例 #21
0
 def test_put_user_password(self, rest_mocker, ms_client, ms_api_schema: dict):
     """Test case for put_user_password"""
     generate_method_test(
         ms_client,
         ms_api_schema,
         "PUT",
         "/user/password",
         rest_mocker,
         mock_request_from_schema=True,
         mock_response_from_schema=True,
     )(user_api.put_user_password)
コード例 #22
0
 def test_get_container_logs(self, rest_mocker, vns3_client, vns3_api_schema: dict):
     """Test case for get_container_logs"""
     generate_method_test(
         vns3_client,
         vns3_api_schema,
         "get",
         "/container_system/containers/{uuid}/logs",
         rest_mocker,
         mock_request_from_schema=True,
         mock_response=NetworkEdgePluginsApiData.ContainerLogsResponse,
     )(network_edge_plugins_api.get_container_logs)
コード例 #23
0
 def test_get_connected_subnets(self, rest_mocker, vns3_client,
                                vns3_api_schema: dict):
     """Test case for get_connected_subnets"""
     generate_method_test(
         vns3_client,
         vns3_api_schema,
         "get",
         "/status/connected_subnets",
         rest_mocker,
         mock_request_from_schema=True,
         mock_response={"response": [["10.0.1.0", "255.255.255.0"]]},
     )(overlay_network_api.get_connected_subnets)
コード例 #24
0
 def test_get_clientpacks(self, rest_mocker, vns3_client,
                          vns3_api_schema: dict):
     """Test case for get_clientpacks"""
     generate_method_test(
         vns3_client,
         vns3_api_schema,
         "get",
         "/clientpacks",
         rest_mocker,
         mock_request_from_schema=True,
         mock_response=OverlayNetworkApiData.ClientpacksListResponse,
     )(overlay_network_api.get_clientpacks)
コード例 #25
0
 def test_put_update_clientpack(self, rest_mocker, vns3_client,
                                vns3_api_schema: dict):
     """Test case for put_update_clientpack"""
     generate_method_test(
         vns3_client,
         vns3_api_schema,
         "put",
         "/clientpack",
         rest_mocker,
         mock_request_from_schema=True,
         mock_response={"response": OverlayNetworkApiData.Clientpack},
     )(overlay_network_api.put_update_clientpack)
コード例 #26
0
 def test_delete_clientpack_tag(self, rest_mocker, vns3_client,
                                vns3_api_schema: dict):
     """Test case for delete_clientpack_tag"""
     generate_method_test(
         vns3_client,
         vns3_api_schema,
         "delete",
         "/clientpack/{clientpack_name}",
         rest_mocker,
         mock_request_from_schema=True,
         mock_response=OverlayNetworkApiData.ClientpackTagsResponse,
     )(overlay_network_api.delete_clientpack_tag)
コード例 #27
0
 def test_post_checkout_next_clientpack(self, rest_mocker, vns3_client,
                                        vns3_api_schema: dict):
     """Test case for post_checkout_next_clientpack"""
     generate_method_test(
         vns3_client,
         vns3_api_schema,
         "post",
         "/clientpacks/next_available",
         rest_mocker,
         mock_request_from_schema=True,
         mock_response=OverlayNetworkApiData.NextClientpackResponse,
     )(overlay_network_api.post_checkout_next_clientpack)
コード例 #28
0
 def test_put_reinitialize_subgroups(self, rest_mocker, vns3_client,
                                     vns3_api_schema: dict):
     """Test case for put_reinitialize_subgroups"""
     generate_method_test(
         vns3_client,
         vns3_api_schema,
         "put",
         "/firewall/rules/subgroup",
         rest_mocker,
         mock_request_from_schema=True,
         mock_response={},
     )(firewall_api.put_reinitialize_subgroups)
コード例 #29
0
 def test_post_generate_remote_support_keypair(self, rest_mocker, ms_client,
                                               ms_api_schema: dict):
     """Test case for post_generate_remote_support_keypair"""
     generate_method_test(
         ms_client,
         ms_api_schema,
         "POST",
         "/system/remote_support/keypair",
         rest_mocker,
         mock_request_from_schema=True,
         mock_response_from_schema=True,
     )(system_api.post_generate_remote_support_keypair)
コード例 #30
0
 def test_get_remote_support_keypair_details(self, rest_mocker, ms_client,
                                             ms_api_schema: dict):
     """Test case for get_remote_support_keypair_details"""
     generate_method_test(
         ms_client,
         ms_api_schema,
         "GET",
         "/system/remote_support/keypair",
         rest_mocker,
         mock_request_from_schema=True,
         mock_response_from_schema=True,
     )(system_api.get_remote_support_keypair_details)