(self, tmpdir, file_svc)
| 51 | os.rmdir(new_dir) |
| 52 | |
| 53 | def test_read_write_result_file(self, tmpdir, file_svc): |
| 54 | link_id = '12345' |
| 55 | output = 'output testing unit' |
| 56 | error = 'error testing unit' |
| 57 | test_exit_code = '0' |
| 58 | output_encoded = str(b64encode(json.dumps(dict(stdout=output, stderr=error, exit_code=test_exit_code)).encode()), 'utf-8') |
| 59 | file_svc.write_result_file(link_id=link_id, output=output_encoded, location=tmpdir) |
| 60 | |
| 61 | expected_output = dict(stdout=output, stderr=error, exit_code=test_exit_code) |
| 62 | output_data = file_svc.read_result_file(link_id=link_id, location=tmpdir) |
| 63 | decoded_output_data = json.loads(base64.b64decode(output_data)) |
| 64 | assert decoded_output_data == expected_output |
| 65 | |
| 66 | def test_read_write_result_file_no_dict(self, tmpdir, file_svc): |
| 67 | link_id = '12345' |
nothing calls this directly
no test coverage detected