예제 #1
0
    def test_template(self):
        t = Template(description="test description",
                     min_packer_version="0.9.0")

        d = t.to_dict()
        assert d['description'] == "test description"
        assert d['min_packer_version'] == "0.9.0"

        t.add_description("new description")
        t.add_min_packer_version("1.0.0")
        d = t.to_dict()
        assert d['description'] == "new description"
        assert d['min_packer_version'] == "1.0.0"
예제 #2
0
    def test_template_variables(self):
        t = Template()

        t.add_variable(UserVar("my_var", "my_value"))

        d = t.to_dict()
        assert d['variables'] == {'my_var': 'my_value'}