Skip to content

Commit

Permalink
test: Update and add test for new root README update feature
Browse files Browse the repository at this point in the history
  • Loading branch information
the-forest-tree committed Sep 4, 2023
1 parent 873f2cb commit 2ea2742
Show file tree
Hide file tree
Showing 9 changed files with 216 additions and 20 deletions.
3 changes: 2 additions & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ max-line-length = 88
exclude = .pytest_cache,__pycache__,.nox
ignore = E731, W503, E203
per-file-ignores =
src/hrflow_connectors/core/documentation.py: E501
src/hrflow_connectors/core/documentation.py: E501
tests/core/test_documentation.py: E501
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
24 changes: 22 additions & 2 deletions tests/core/test_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@
BaseActionParameters,
Connector,
ConnectorAction,
ConnectorType,
ParametersOverride,
ReadMode,
WorkflowType,
backend,
)
from hrflow_connectors.core.connector import Event, Reason, RunResult, Status
from tests.conftest import random_workflow_id
from tests.core.localusers.warehouse import (
from tests.core.src.hrflow_connectors.connectors.localusers.warehouse import (
FAIL_AT,
USERS_DB,
BadUsersWarehouse,
Expand All @@ -29,7 +30,7 @@
UsersWarehouse,
add_user,
)
from tests.core.smartleads.warehouse import (
from tests.core.src.hrflow_connectors.connectors.smartleads.warehouse import (
LEADS_DB,
BadLeadsWarehouse,
FailingLeadsWarehouse,
Expand All @@ -40,6 +41,7 @@

SmartLeadsF = lambda: Connector(
name="SmartLeads",
type=ConnectorType.Other,
description=DESCRIPTION,
url="https://www.smartleads.test/",
actions=[
Expand Down Expand Up @@ -120,6 +122,7 @@ def test_action_name_constraint():
with pytest.raises(ValidationError) as excinfo:
Connector(
name="SmartLeads",
type=ConnectorType.Other,
description=DESCRIPTION,
url="https://www.smartleads.test/",
actions=[
Expand All @@ -144,6 +147,7 @@ def test_action_pull_profile_list_only_with_trigger_type_pull():
with pytest.raises(ValidationError) as excinfo:
Connector(
name="SmartLeads",
type=ConnectorType.Other,
description=DESCRIPTION,
url="https://www.smartleads.test/",
actions=[
Expand Down Expand Up @@ -172,6 +176,7 @@ def test_action_pull_job_list_only_with_trigger_type_pull():
with pytest.raises(ValidationError) as excinfo:
Connector(
name="SmartLeads",
type=ConnectorType.Other,
description=DESCRIPTION,
url="https://www.smartleads.test/",
actions=[
Expand Down Expand Up @@ -248,6 +253,7 @@ def test_connector_failures():
def test_origin_warehouse_failure():
connector = Connector(
name="SmartLeads",
type=ConnectorType.Other,
description=DESCRIPTION,
url="https://www.smartleads.test/",
actions=[
Expand Down Expand Up @@ -278,6 +284,7 @@ def test_origin_not_readable_failure():
with pytest.raises(ValidationError) as excinfo:
Connector(
name="SmartLeads",
type=ConnectorType.Other,
description=DESCRIPTION,
url="https://www.smartleads.test/",
actions=[
Expand All @@ -301,6 +308,7 @@ def test_origin_not_readable_failure():
def test_target_warehouse_failure():
connector = Connector(
name="SmartLeads",
type=ConnectorType.Other,
description=DESCRIPTION,
url="https://www.smartleads.test/",
actions=[
Expand Down Expand Up @@ -331,6 +339,7 @@ def test_target_not_writable_failure():
with pytest.raises(ValidationError) as excinfo:
Connector(
name="SmartLeads",
type=ConnectorType.Other,
description=DESCRIPTION,
url="https://www.smartleads.test/",
actions=[
Expand Down Expand Up @@ -495,6 +504,7 @@ def smarter_format(user):

EvenSmarterLeads = Connector(
name="SmartLeads",
type=ConnectorType.Other,
description=DESCRIPTION,
url="https://www.smartleads.test/",
actions=[
Expand Down Expand Up @@ -578,6 +588,7 @@ def failing_logic(user):

FailingSmartLeads = Connector(
name="SmartLeads",
type=ConnectorType.Other,
description=DESCRIPTION,
url="https://www.smartleads.test/",
actions=[
Expand Down Expand Up @@ -723,6 +734,7 @@ def callback(origin_parameters, target_parameters, events, written_items) -> Non

SmartLeads = Connector(
name="SmartLeads",
type=ConnectorType.Other,
description=DESCRIPTION,
url="https://www.smartleads.test/",
actions=[
Expand Down Expand Up @@ -766,6 +778,7 @@ def callback(origin_parameters, target_parameters, events, written_items) -> Non

SmartLeads = Connector(
name="SmartLeads",
type=ConnectorType.Other,
description=DESCRIPTION,
url="https://www.smartleads.test/",
actions=[
Expand Down Expand Up @@ -1265,6 +1278,7 @@ def test_connector_based_on_simple():
SmartLeadsCopy = Connector.based_on(
base=SmartLeads,
name="SmartLeadsCopy",
type=ConnectorType.Other,
description="SmartLeadsCopy",
url="Some URL",
)
Expand All @@ -1287,6 +1301,7 @@ def test_connector_based_on_action_override():
SmartLeadsCopy = Connector.based_on(
base=SmartLeads,
name="SmartLeadsCopy",
type=ConnectorType.Other,
description="SmartLeadsCopy",
url="Some URL",
with_actions=[
Expand Down Expand Up @@ -1331,6 +1346,7 @@ def test_connector_based_on_new_action():
SmartLeadsCopy = Connector.based_on(
base=SmartLeads,
name="SmartLeadsCopy",
type=ConnectorType.Other,
description="SmartLeadsCopy",
url="Some URL",
with_actions=[
Expand Down Expand Up @@ -1384,6 +1400,7 @@ def new_event_parser(*args, **kwargs):
SmartLeadsCopy = Connector.based_on(
base=SmartLeads,
name="SmartLeadsCopy",
type=ConnectorType.Other,
description="SmartLeadsCopy",
url="Some URL",
with_parameters_override=[
Expand Down Expand Up @@ -1452,6 +1469,7 @@ def new_event_parser(*args, **kwargs):
SmartLeadsCopy = Connector.based_on(
base=SmartLeads,
name="SmartLeadsCopy",
type=ConnectorType.Other,
description="SmartLeadsCopy",
url="Some URL",
with_parameters_override=[
Expand Down Expand Up @@ -1594,6 +1612,7 @@ def new_format(*args, **kwargs):
Connector.based_on(
base=SmartLeads,
name="SmartLeadsCopy",
type=ConnectorType.Other,
description="SmartLeadsCopy",
url="Some URL",
with_parameters_override=[
Expand Down Expand Up @@ -1624,6 +1643,7 @@ def new_format(*args, **kwargs):
Connector.based_on(
base=SmartLeads,
name="SmartLeadsCopy",
type=ConnectorType.Other,
description="SmartLeadsCopy",
url="Some URL",
with_parameters_override=[
Expand Down
Loading

0 comments on commit 2ea2742

Please sign in to comment.