Skip to content

Commit fe91aab

Browse files
committed
tests: add tests for new get_tool behaviour
Add tests to make codecov happy. Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de> (cherry picked from commit e92dcca) Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
1 parent c1ffb5b commit fe91aab

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

tests/test_config.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,3 +100,30 @@ def test_template_bad_key(tmpdir):
100100
with pytest.raises(InvalidConfigError) as excinfo:
101101
Config(str(p))
102102
assert "unknown variable" in excinfo.value.msg
103+
104+
def test_tool(tmpdir):
105+
t = tmpdir.join("testtool")
106+
t.write("content")
107+
p = tmpdir.join("config.yaml")
108+
p.write(
109+
"""
110+
tools:
111+
testtool: {}
112+
""".format(t)
113+
)
114+
c = Config(str(p))
115+
116+
assert c.get_tool("testtool") == t
117+
118+
def test_tool_no_explicit_tool(tmpdir):
119+
t = tmpdir.join("testtool")
120+
t.write("content")
121+
p = tmpdir.join("config.yaml")
122+
p.write(
123+
"""
124+
dict: {}
125+
"""
126+
)
127+
c = Config(str(p))
128+
129+
assert c.get_tool("testtool") == "testtool"

0 commit comments

Comments
 (0)