Skip to content

Commit

Permalink
test: update old tests to pass
Browse files Browse the repository at this point in the history
  • Loading branch information
julesbertrand committed Jan 2, 2024
1 parent 3ae7b81 commit e5004bb
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tests/unit_tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ def func(a: Optional[int], b: str) -> bool:
assert result.__name__ == "func"
assert result.model_json_schema()["properties"] == expected_properties

def test_create_model_from_pipeline_success(self, dummy_pipeline_fixture):
def test_create_model_from_pipeline_success(self, test_pipeline_fixture):
# Given
pipeline = dummy_pipeline_fixture
pipeline = test_pipeline_fixture

# When
result = create_model_from_func(pipeline.pipeline_func)

# Then
assert issubclass(result, CustomBaseModel)
assert result.__name__ == "dummy_pipeline"
assert result.__name__ == "test_pipeline"

def test_create_model_from_func_none_pipeline(self):
# Given
Expand All @@ -44,18 +44,18 @@ def test_create_model_from_func_none_pipeline(self):
with pytest.raises(AttributeError):
create_model_from_func(pipeline)

def test_create_model_from_func_none_pipeline_func(self, dummy_pipeline_fixture):
def test_create_model_from_func_none_pipeline_func(self, test_pipeline_fixture):
# Given
pipeline = dummy_pipeline_fixture
pipeline = test_pipeline_fixture
pipeline.pipeline_func = None

# When / Then
with pytest.raises(TypeError):
create_model_from_func(pipeline.pipeline_func, name="dummy_pipeline")

def test_create_model_from_func_types_are_good(self, dummy_pipeline_fixture):
def test_create_model_from_func_types_are_good(self, test_pipeline_fixture):
# Given
pipeline = dummy_pipeline_fixture
pipeline = test_pipeline_fixture
expected_properties = {
"name": {"title": "Name", "type": "string"},
"artifact": {"title": "Artifact", "type": "string"},
Expand Down

0 comments on commit e5004bb

Please sign in to comment.