Get the contents of a test resource file.
(path)
| 78 | |
| 79 | |
| 80 | def read_flight_resource(path): |
| 81 | """Get the contents of a test resource file.""" |
| 82 | root = resource_root() |
| 83 | if not root: |
| 84 | return None |
| 85 | try: |
| 86 | with (root / path).open("rb") as f: |
| 87 | return f.read() |
| 88 | except FileNotFoundError: |
| 89 | raise RuntimeError( |
| 90 | f"Test resource {root / path} not found; did you initialize the " |
| 91 | f"test resource submodule?\n{traceback.format_exc()}" |
| 92 | ) |
| 93 | |
| 94 | |
| 95 | def example_tls_certs(): |
no test coverage detected