Skip to content

Commit

Permalink
now fully tested
Browse files Browse the repository at this point in the history
  • Loading branch information
sanderegg committed Aug 26, 2024
1 parent 448a1d5 commit b2a68b6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,6 @@ def load_pre_pulled_images_from_tags(tags: EC2Tags) -> list[DockerGenericTag]:
),
)
)

return parse_raw_as(list[DockerGenericTag], assembled_json)
if assembled_json:
return parse_raw_as(list[DockerGenericTag], assembled_json)
return []
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# pylint:disable=redefined-outer-name
import pytest
from aws_library.ec2 import AWSTagKey, AWSTagValue, EC2Tags
from faker import Faker
from fastapi import FastAPI
from models_library.docker import DockerGenericTag
from pydantic import parse_obj_as
Expand Down Expand Up @@ -169,3 +170,7 @@ def test_dump_load_pre_pulled_images_as_tags(
):
assert dump_pre_pulled_images_as_tags(images) == expected_tags
assert load_pre_pulled_images_from_tags(expected_tags) == images


def test_load_pre_pulled_images_as_tags_no_tag_present_returns_empty_list(faker: Faker):
assert load_pre_pulled_images_from_tags(faker.pydict(allowed_types=(str,))) == []

0 comments on commit b2a68b6

Please sign in to comment.