Skip to content
This repository has been archived by the owner on Oct 3, 2020. It is now read-only.

Commit

Permalink
test get_by_name
Browse files Browse the repository at this point in the history
  • Loading branch information
hjacobs committed Mar 3, 2019
1 parent 2ab291d commit f838a61
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ def test_get_pod_by_name(api, requests_mock):
pod = pykube.Pod.objects(api).filter(namespace="gondor-system").get_or_none(name="my-pod")
assert pod.obj["spec"]["containers"][0]["image"] == 'hjacobs/kube-janitor'

pod = pykube.Pod.objects(api).filter(namespace="gondor-system").get_by_name("my-pod")
assert pod.obj["spec"]["containers"][0]["image"] == 'hjacobs/kube-janitor'

pod = pykube.Pod.objects(api).filter(namespace="gondor-system").get_or_none(name="other-pod")
assert pod is None

Expand Down

0 comments on commit f838a61

Please sign in to comment.