| Conditions | 2 |
| Total Lines | 11 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | # Copyright 2022, Red Hat, Inc. |
||
| 31 | @pytest.mark.unit_test |
||
| 32 | @pytest.mark.usefixtures("remove_generated_file") |
||
| 33 | @mock.patch('argparse.ArgumentParser.parse_args', |
||
| 34 | return_value=get_fake_args()) |
||
| 35 | def test_store_file(mock_args): # pylint: disable=W0613 |
||
| 36 | api = CommandLineAPI() |
||
| 37 | data = BytesIO(b'<html><h1>TEST DATA</h1></html>') |
||
| 38 | api.store_file(data) |
||
| 39 | api.close_files() |
||
| 40 | with open(PATH_TO_RESULT_FILE, "r", encoding="utf-8") as result_file: |
||
| 41 | assert result_file.read() == data.getvalue().decode("utf-8") |
||
| 42 |