Skip to content

Commit 84039fc

Browse files
committed
Updated testing
Signed-off-by: shlao <[email protected]>
1 parent f1fc6aa commit 84039fc

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

insights/tests/datasources/test_host_key_files.py

+11
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,14 @@ def test_host_key_files(mock_exists, mock_ds_open):
3131

3232
expected = DatasourceProvider(content=EXPECTED_RESULT, relative_path=RELATIVE_PATH)
3333
assert len(result.content) == len(expected.content) == 2
34+
35+
36+
@patch(
37+
'insights.specs.datasources.host_key_files.open', new_callable=mock_open, read_data=[""]
38+
)
39+
@patch('os.path.exists')
40+
def test_host_key_files_empty_log(mock_exists, mock_ds_open):
41+
broker = {}
42+
with pytest.raises(SkipComponent) as e:
43+
host_key_files(broker)
44+
assert 'SkipComponent' in str(e)

0 commit comments

Comments
 (0)