def _create_image(dockerfile_mode="actual"): img = Image() img.id = image_id img.user_id = user img.dockerfile_contents = dockerfile_contents img.dockerfile_mode = dockerfile_mode return img
def image(monkeypatch): monkeypatch.setattr(Image, 'analysis_artifacts', MockAnalysisArtifacts(), raising=True) img = Image() img.id = image_id img.digest = digest img.user_id = user return img
def _create_image(artifact_key): monkeypatch.setattr( Image, "analysis_artifacts", MockAnalysisArtifacts(artifact_key), raising=True, ) img = Image() img.id = image_id img.digest = digest img.user_id = user return img
def alpine_image(): img = Image() img.distro_name = "alpine" img.distro_version = "3.10" img.id = "abc123abc123" img.analysis_artifacts = [] img.digest = "sha256:abc123abc123" img.created_at = datetime.datetime.utcnow() img.last_modified = img.created_at img.cpes = [] img.docker_data_json = {} img.dockerfile_contents = "" img.dockerfile_mode = "guessed" img.docker_history_json = [] img.packages = [] img.gems = [] img.npms = [] img.state = "analyzed" img.size = "1000" img.user_id = "admin" return img