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