File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -661,3 +661,27 @@ def test_get_cluster_queue(
661661 plural = "clusterqueues" ,
662662 name = "test-cluster-queue" ,
663663 )
664+
665+ @patch (
666+ "kubernetes.client.CoreV1Api" ,
667+ return_value = Mock (
668+ read_namespace = Mock (
669+ return_value = V1Namespace (metadata = V1ObjectMeta (name = "test" ))
670+ )
671+ ),
672+ )
673+ def test_check_if_namespace_exists_true (self , mock_core_client : Mock ):
674+ test_client = KubernetesClient ()
675+ result = test_client .check_if_namespace_exists ("kubeflow" )
676+ self .assertTrue (result )
677+
678+ @patch (
679+ "kubernetes.client.CoreV1Api" ,
680+ side_effect = client .rest .ApiException (
681+ status = 404 ,
682+ ),
683+ )
684+ def test_check_if_namespace_exists_false (self , mock_core_client : Mock ):
685+ test_client = KubernetesClient ()
686+ result = test_client .check_if_namespace_exists ("abcdef" )
687+ self .assertFalse (result )
You can’t perform that action at this time.
0 commit comments