def __mock_update_namespaced_custom_object(self, group='example.com', kind='MyCustom', plural='mycustoms'): self.update_method, self.update_is_namespaced, self.update_is_custom_object = ( MagicMock(), True, True) self.client_director.determine_api_method_for_update_object.return_value = ( self.update_method, self.update_is_namespaced, self.update_is_custom_object) self.crds.append(build_crd(group=group, kind=kind, plural=plural))
def __mock_read_cluster_custom_object(self, group='example.com', kind='MyCustom', plural='mycustoms'): self.read_method, self.read_is_namespaced, self.read_is_custom_object = ( MagicMock(), False, True) self.client_director.determine_api_method_for_read_object.return_value = ( self.read_method, self.read_is_namespaced, self.read_is_custom_object) self.crds.append( build_crd(group=group, kind=kind, plural=plural, scope='Cluster'))
def _mock_cluster_crd(self, **kwargs): kwargs['scope'] = 'Cluster' crd = build_crd(**kwargs) self.crd_director.get_crd_by_kind.return_value = crd
def _add_crd(self, **kwargs): crd = build_crd(**kwargs) self.crds.append(crd) return crd
def _mock_namespaced_crd(self, **kwargs): kwargs['scope'] = 'Namespaced' crd = build_crd(**kwargs) self.crd_director.get_crd_by_kind.return_value = crd