@@ -35,14 +35,38 @@ 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 (
54+ "organization_id" ,
55+ "my-organization" ,
56+ suspended = True ,
57+ meta_labels = {"label_name" : "label_value" },
58+ meta_annotations = {"annotation_name" : "annotation_value" }
59+ )
60+ self .client .patch .assert_called_with (
61+ self .client .patch .return_value .url ,
62+ json = {
63+ "suspended" : True ,
64+ "name" : "my-organization" ,
65+ "metadata" : {
66+ "labels" : {"label_name" : "label_value" },
67+ "annotations" : {"annotation_name" : "annotation_value" }
68+ }
69+ },
4670 )
4771 self .assertIsNotNone (result )
4872
0 commit comments