@@ -35,14 +35,25 @@ def test_get(self):
3535 self .assertEqual ("my-organization" , organization ["name" ])
3636 self .assertIsInstance (organization , Entity )
3737
38- def test_update (self ):
38+ def test_update_without_optional_parameters (self ):
3939 self .client .patch .return_value = self .mock_response (
4040 "/v3/organizations/organization_id" , HTTPStatus .OK , None , "v3" , "organizations" , "PATCH_{id}_response.json"
4141 )
42- result = self .client .v3 .organizations .update ("organization_id" , "my-organization" , suspended = True )
42+ result = self .client .v3 .organizations .update ("organization_id" , "my-organization" )
4343 self .client .patch .assert_called_with (
4444 self .client .patch .return_value .url ,
45- json = {"suspended" : True , "name" : "my-organization" , "metadata" : {"labels" : None , "annotations" : None }},
45+ json = {"name" : "my-organization" },
46+ )
47+ self .assertIsNotNone (result )
48+
49+ def test_update_with_optional_parameters (self ):
50+ self .client .patch .return_value = self .mock_response (
51+ "/v3/organizations/organization_id" , HTTPStatus .OK , None , "v3" , "organizations" , "PATCH_{id}_response.json"
52+ )
53+ result = self .client .v3 .organizations .update ("organization_id" , "my-organization" , suspended = True , meta_labels = {"label_name" : "label_value" }, meta_annotations = {"annotation_name" : "annotation_value" })
54+ self .client .patch .assert_called_with (
55+ self .client .patch .return_value .url ,
56+ json = {"suspended" : True , "name" : "my-organization" , "metadata" : {"labels" : {"label_name" : "label_value" }, "annotations" : {"annotation_name" : "annotation_value" }}},
4657 )
4758 self .assertIsNotNone (result )
4859
0 commit comments