Exemple #1
0
 def test_load_from_empty_dump(self):
     wf_data = ImageBuildWorkflowData.load({})
     empty_data = ImageBuildWorkflowData()
     field: Field
     for field in fields(ImageBuildWorkflowData):
         name = field.name
         assert getattr(empty_data, name) == getattr(wf_data, name)
Exemple #2
0
    def test_load_from_dump(self):
        input_data = {
            "dockerfile_images": {
                "original_parents": ["scratch"],
                "local_parents": [],
                "source_registry": None,
                "organization": None,
            },
            "plugins_results": {
                "plugin_1": "result"
            },
            "tag_conf": {
                "floating_images": [
                    ImageName.parse("registry/httpd:2.4").to_str(),
                ],
            },
        }
        wf_data = ImageBuildWorkflowData.load(input_data)

        expected_df_images = DockerfileImages.load(
            input_data["dockerfile_images"])
        assert expected_df_images == wf_data.dockerfile_images
        assert input_data["plugins_results"] == wf_data.plugins_results
        assert TagConf.load(input_data["tag_conf"]) == wf_data.tag_conf