Skip to content

Commit

Permalink
Edited test_score_definitions for syntax issue
Browse files Browse the repository at this point in the history
  • Loading branch information
samyarpotlapalli committed Aug 30, 2024
1 parent 223d671 commit 2ab0c9f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/sasctl/_services/score_definitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,14 @@ def create_score_definition(
"""

model = cls._model_repository.get_model(model)
model_id = model.id

if not model:
raise HTTPError(
{
f"This model may not exist in a project or the model may not exist at all."
}
)
model_id = model.id
model_project_id = model.get("projectId")
model_project_version_id = model.get("projectVersionId")
model_name = model.get("name")
Expand Down
15 changes: 8 additions & 7 deletions tests/unit/test_score_definitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@


class CustomMock:
def __init__(self, json_info):
def __init__(self, json_info, id=""):
self.json_info = json_info
self.id = id

def get(self, key1, key2=None, key3=None):
if key2 is None and key3 is None:
Expand Down Expand Up @@ -69,7 +70,7 @@ def test_create_score_definition():
with pytest.raises(HTTPError):
sd.create_score_definition(
score_def_name="test_create_sd",
model_id="12345",
model="12345",
table_name="test_table",
)

Expand All @@ -87,7 +88,7 @@ def test_create_score_definition():
with pytest.raises(HTTPError):
sd.create_score_definition(
score_def_name="test_create_sd",
model_id="12345",
model="12345",
table_name="test_table",
)

Expand All @@ -98,7 +99,7 @@ def test_create_score_definition():
with pytest.raises(HTTPError):
sd.create_score_definition(
score_def_name="test_create_sd",
model_id="12345",
model="12345",
table_name="test_table",
table_file="test_path",
)
Expand All @@ -112,7 +113,7 @@ def test_create_score_definition():
get_table.return_value = get_table_mock
response = sd.create_score_definition(
score_def_name="test_create_sd",
model_id="12345",
model="12345",
table_name="test_table",
table_file="test_path",
)
Expand All @@ -122,7 +123,7 @@ def test_create_score_definition():
get_table.return_value = get_table_mock
response = sd.create_score_definition(
score_def_name="test_create_sd",
model_id="12345",
model="12345",
table_name="test_table",
table_file="test_path",
)
Expand All @@ -146,7 +147,7 @@ def test_create_score_definition():
get_table.return_value = get_table_mock
response = sd.create_score_definition(
score_def_name="test_create_sd",
model_id="12345",
model="12345",
table_name="test_table",
)
assert response
Expand Down

0 comments on commit 2ab0c9f

Please sign in to comment.