(monkeypatch)
| 32 | |
| 33 | |
| 34 | def test_simple(monkeypatch): |
| 35 | monkeypatch.delenv("PATHWAY_PERSISTENT_STORAGE", raising=False) |
| 36 | |
| 37 | class OutputSchema(pw.Schema): |
| 38 | ret: int |
| 39 | |
| 40 | class TestAsyncTransformer(pw.AsyncTransformer, output_schema=OutputSchema): |
| 41 | async def invoke(self, value: int) -> dict[str, Any]: |
| 42 | await asyncio.sleep(random.uniform(0, 0.1)) |
| 43 | return dict(ret=value + 1) |
| 44 | |
| 45 | input_table = T( |
| 46 | """ |
| 47 | | value |
| 48 | 1 | 1 |
| 49 | 2 | 2 |
| 50 | 3 | 3 |
| 51 | """ |
| 52 | ) |
| 53 | |
| 54 | result = TestAsyncTransformer(input_table=input_table).successful |
| 55 | |
| 56 | assert result._universe.is_subset_of(input_table._universe) |
| 57 | |
| 58 | assert_table_equality( |
| 59 | result, |
| 60 | T( |
| 61 | """ |
| 62 | | ret |
| 63 | 1 | 2 |
| 64 | 2 | 3 |
| 65 | 3 | 4 |
| 66 | """ |
| 67 | ), |
| 68 | ) |
| 69 | |
| 70 | |
| 71 | def test_file_io(monkeypatch, tmp_path: pathlib.Path): |
nothing calls this directly
no test coverage detected