Skip to content

Commit

Permalink
fix: connectors tests
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas committed Sep 5, 2024
1 parent 65f24f0 commit aa658c3
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions tests/core/test_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -1292,6 +1292,7 @@ def test_connector_based_on_simple():
base=SmartLeads,
name="SmartLeadsCopy",
type=ConnectorType.Other,
subtype="smartleadscopy",
description="SmartLeadsCopy",
url="Some URL",
)
Expand All @@ -1315,6 +1316,7 @@ def test_connector_based_on_action_override():
base=SmartLeads,
name="SmartLeadsCopy",
type=ConnectorType.Other,
subtype="smartleadscopy",
description="SmartLeadsCopy",
url="Some URL",
with_actions=[
Expand Down Expand Up @@ -1360,6 +1362,7 @@ def test_connector_based_on_new_action():
base=SmartLeads,
name="SmartLeadsCopy",
type=ConnectorType.Other,
subtype="smartleadscopy",
description="SmartLeadsCopy",
url="Some URL",
with_actions=[
Expand Down Expand Up @@ -1414,6 +1417,7 @@ def new_event_parser(*args, **kwargs):
base=SmartLeads,
name="SmartLeadsCopy",
type=ConnectorType.Other,
subtype="smartleadscopy",
description="SmartLeadsCopy",
url="Some URL",
with_parameters_override=[
Expand Down Expand Up @@ -1483,6 +1487,7 @@ def new_event_parser(*args, **kwargs):
base=SmartLeads,
name="SmartLeadsCopy",
type=ConnectorType.Other,
subtype="smartleadscopy",
description="SmartLeadsCopy",
url="Some URL",
with_parameters_override=[
Expand Down Expand Up @@ -1626,6 +1631,7 @@ def new_format(*args, **kwargs):
base=SmartLeads,
name="SmartLeadsCopy",
type=ConnectorType.Other,
subtype="smartleadscopy",
description="SmartLeadsCopy",
url="Some URL",
with_parameters_override=[
Expand Down Expand Up @@ -1657,6 +1663,7 @@ def new_format(*args, **kwargs):
base=SmartLeads,
name="SmartLeadsCopy",
type=ConnectorType.Other,
subtype="smartleadscopy",
description="SmartLeadsCopy",
url="Some URL",
with_parameters_override=[
Expand Down Expand Up @@ -1701,16 +1708,11 @@ def test_connector_subtype_constraint():
Connector(
name="SmartLeads",
type=ConnectorType.Other,
subtype="smartleads",
subtype=subtype,
description=DESCRIPTION,
url="https://www.smartleads.test/",
actions=[],
)
expected_error = (
"1 validation error for ConnectorModel\nsubtype\n ConnectorModel's"
" `subtype`={} must be lowercase without any spaces. (type=value_error)".format(
subtype
)
)
assert str(excinfo.value) == expected_error
errors = excinfo.value.errors()
assert errors[0]["loc"] == ("subtype",)
assert errors[0]["msg"].startswith('string does not match regex "')

0 comments on commit aa658c3

Please sign in to comment.