Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Salesforce instance fixture in tests/unit/test_salesforce.py #1055

Open
mgardzinski opened this issue Sep 25, 2024 · 0 comments
Open

Use Salesforce instance fixture in tests/unit/test_salesforce.py #1055

mgardzinski opened this issue Sep 25, 2024 · 0 comments
Labels
2.0 backlog Backlog for logic issues in connectors after migration 2.0 viadot 2.0 enhancement New feature or request

Comments

@mgardzinski
Copy link

Repeating part that needs to be replaced in tests:

  mock_sf_instance = mocker.MagicMock(spec=Salesforce)
  mocker.patch("viadot.sources.salesforce.Salesforce", return_value=mock_sf_instance)

Suggested change for fixture:

@pytest.fixture
def mock_salesforce(mocker):
    """Fixture to mock the Salesforce instance."""
    mock_sf_instance = mocker.MagicMock(spec=SimpleSalesforce)
    mocker.patch("viadot.sources.salesforce.Salesforce", return_value=mock_sf_instance)
    return mock_sf_instance
@mgardzinski mgardzinski added 2.0 backlog Backlog for logic issues in connectors after migration and removed 2.0 backlog Backlog for logic issues in connectors after migration labels Sep 25, 2024
@trymzet trymzet changed the title Repeated mocking of salesforce instance should be refactored into a fixture in tests/unit/test_salesforce.py Use Salesforce instance fixture in tests/unit/test_salesforce.py Sep 30, 2024
@trymzet trymzet added enhancement New feature or request 2.0 viadot 2.0 labels Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.0 backlog Backlog for logic issues in connectors after migration 2.0 viadot 2.0 enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants