Open hrshdhgd opened 1 month ago
For now in my project I added this:
# Mock koza transform fixture
@pytest.fixture
def mock_koza():
def _mock_koza(ingest_name, data, transform_script):
# Simulate the transformation process
if isinstance(data, dict):
data = [data]
result = []
for row in data:
entity_a = type('Entity', (object,), {'name': row["example_column_1"]})
entity_b = type('Entity', (object,), {'name': row["example_column_2"]})
association = row["example_column_3"]
result.extend([entity_a, entity_b, association])
return result
return _mock_koza
I'm not sure if this aligns with your preference, but just something that passes test for now.
is this before or after running make/poetry install?
After
When you create a project from scratch and run
pytest
, it fails with the following error:Reason being
mock_koza
does not seem to be defined in thetest_example.py