-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
36 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from kqueen.kubeapi import KubernetesAPI | ||
|
||
import pytest | ||
|
||
|
||
class TestKubeApi: | ||
def test_missing_cluster_param(self): | ||
with pytest.raises(ValueError, match='Missing parameter cluster'): | ||
KubernetesAPI() | ||
|
||
def test_get_kubeconfig(self, cluster): | ||
"""Test get_kubeconfig returns YAML""" | ||
|
||
cluster.save() | ||
api = KubernetesAPI(cluster=cluster) | ||
print(api.get_kubeconfig_file()) | ||
|
||
def test_init(self, cluster): | ||
cluster.save() | ||
|
||
api = KubernetesAPI(cluster=cluster) | ||
|
||
assert hasattr(api, 'cluster') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,6 @@ | |
from pprint import pprint | ||
|
||
import pytest | ||
import json | ||
|
||
|
||
class TestModelMethods: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
apiVersion: v1 | ||
clusters: | ||
- cluster: | ||
server: http://127.0.0.1:8080 | ||
name: local | ||
contexts: | ||
- context: | ||
cluster: local | ||
user: "" | ||
name: local | ||
current-context: local | ||
kind: Config | ||
preferences: {} |