def test_check_registry_quay_no_containers(): manifest = yaml.safe_load(dedent(""" --- apiVersion: apps.openshift.io/v1 kind: DeploymentConfig spec: template: spec: """)) c = CheckRegistryQuay() result = c.check_registry_quay(manifest) assert isinstance(result, CheckSuccess)
def test_check_registry_quay_bad_origin(): manifest = yaml.safe_load(dedent(""" --- apiVersion: apps.openshift.io/v1 kind: DeploymentConfig spec: template: spec: containers: - name: c1 image: bla/bla """)) c = CheckRegistryQuay() result = c.check_registry_quay(manifest) assert isinstance(result, CheckError)
def test_check_registry_quay_cron_job(): manifest = yaml.safe_load(dedent(""" --- apiVersion: apps.openshift.io/v1 kind: CronJob spec: jobTemplate: spec: template: spec: containers: - name: i1 image: quay.io/a/b """)) c = CheckRegistryQuay() result = c.check_registry_quay(manifest) assert isinstance(result, CheckSuccess)