| 33 | |
| 34 | |
| 35 | class DummyStream(Stream): |
| 36 | tool_model = DummyToolModel |
| 37 | domain_types = [DomainType.CROSS] |
| 38 | |
| 39 | def collect(self, state, context): |
| 40 | for i, each in enumerate(context.connection.raw_data): |
| 41 | count = state.get("count", 0) |
| 42 | yield each, {"count": count + i} |
| 43 | |
| 44 | def extract(self, raw) -> ToolModel: |
| 45 | return DummyToolModel( |
| 46 | id=raw["i"], |
| 47 | name=raw["n"] |
| 48 | ) |
| 49 | |
| 50 | def convert(self, tm, ctx): |
| 51 | return DummyDomainModel( |
| 52 | ID=tm.id, |
| 53 | Name=tm.name, |
| 54 | ) |
| 55 | |
| 56 | |
| 57 | class DummyConnection(Connection): |