def testSetIamPolicyFolder_clearBindingsAndEtag_policySetsBindingsAndEtag(
            self):
        policy = self._GetTestIamPolicy(clear_fields=['bindings', 'etag'])
        expected_request = (
            self.messages.CloudresourcemanagerFoldersSetIamPolicyRequest(
                foldersId=folders.FolderIdToName(self.TEST_FOLDER.name),
                setIamPolicyRequest=self.messages.SetIamPolicyRequest(
                    policy=policy,
                    updateMask='auditConfigs,version,bindings,etag',
                ),
            ))

        self.mock_folders.SetIamPolicy.Expect(expected_request, policy)

        # Setting the IAM policy yields no result, it's just a side-effect,
        # so we offload the test assertion to the mock.
        self.DoRequest(policy)
 def DefaultRequest(self):
     return self.messages.CloudresourcemanagerFoldersSetIamPolicyRequest(
         foldersId=folders.FolderIdToName(self.TEST_FOLDER.name),
         setIamPolicyRequest=self.messages.SetIamPolicyRequest(
             policy=self._MakePolicy(), updateMask='bindings,etag,version'))
 def RunSetIamPolicy(self, policy_file_path):
     self.RunFolders('set-iam-policy',
                     folders.FolderIdToName(self.TEST_FOLDER.name),
                     policy_file_path)