Esempio n. 1
0
 def test_docker_on_kubernetes_environment_execution_raises_error_out_of_cluster(
     self
 ):
     env = kubernetes.DockerOnKubernetesEnvironment(base_image="a")
     with pytest.raises(EnvironmentError) as exc:
         env.execute()
     assert "Environment not currently inside a cluster" in str(exc.value)
Esempio n. 2
0
 def test_docker_on_kubernetes_environment_variables(self):
     env = kubernetes.DockerOnKubernetesEnvironment(
         base_image="a",
         registry_url="b",
         python_dependencies=["c"],
         image_name="d",
         image_tag="e",
         env_vars={"f": "g"},
         files={"/": "/"},
     )
     assert env.base_image == "a"
     assert env.registry_url == "b"
     assert env.python_dependencies == ["c"]
     assert env.image_name == "d"
     assert env.image_tag == "e"
     assert env.env_vars == {"f": "g"}
     assert env.files == {"/": "/"}
Esempio n. 3
0
 def test_docker_on_kubernetes_environment_setup_does_nothing(self):
     env = kubernetes.DockerOnKubernetesEnvironment(base_image="a")
     env.setup()
     assert env
Esempio n. 4
0
 def test_docker_on_kubernetes_environment_identifier_label(self):
     env = kubernetes.DockerOnKubernetesEnvironment(base_image="a")
     assert env.identifier_label
Esempio n. 5
0
 def test_docker_on_kubernetes_environment_has_default_image(self):
     env = kubernetes.DockerOnKubernetesEnvironment()
     assert env.base_image == "python:3.6"
Esempio n. 6
0
 def test_create_docker_on_kubernetes_environment(self):
     env = kubernetes.DockerOnKubernetesEnvironment(base_image="a")
     assert env