Skip to content

Instantly share code, notes, and snippets.

@rnrbarbosa
Last active May 26, 2019 22:14
Show Gist options
  • Save rnrbarbosa/4f8faf7054ad7f9973d7e55803298b0e to your computer and use it in GitHub Desktop.
Save rnrbarbosa/4f8faf7054ad7f9973d7e55803298b0e to your computer and use it in GitHub Desktop.

KUBERNETES TEST

from pytest import fixture
from kubernetes import client, config
@pytest.fixture
def pods():
config.load_kube_config()
v1 = client.CoreV1Api()
pods = v1.list_pod_for_all_namespaces(watch=False)
return pods
minikube start --extra-config=apiserver.runtime-config=settings.k8s.io/v1alpha1=true
import pytest
def test_pods(pods):
for p in pods.items:
print(p.metadata.name)
assert p.status.phase in ['Running','Completed']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment