Skip to content

Commit b6d5900

Browse files
committed
update
1 parent aea43e3 commit b6d5900

2 files changed

Lines changed: 14 additions & 11 deletions

File tree

tests/test_credentials.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def test_from_env(self):
1818
"client_id": "test_client_id",
1919
"client_secret": "test_secret",
2020
"login_url": "https://test.login.url",
21-
"dataspace": "test_dataspace", # Added dataspace
21+
"dataspace": "test_dataspace",
2222
}
2323

2424
with patch.dict(
@@ -31,7 +31,7 @@ def test_from_env(self):
3131
assert creds.client_id == test_creds["client_id"]
3232
assert creds.client_secret == test_creds["client_secret"]
3333
assert creds.login_url == test_creds["login_url"]
34-
assert creds.dataspace == test_creds["dataspace"] # Added dataspace assertion
34+
assert creds.dataspace == test_creds["dataspace"]
3535

3636
def test_from_env_without_dataspace(self):
3737
"""Test loading credentials from environment variables without dataspace."""
@@ -44,8 +44,10 @@ def test_from_env_without_dataspace(self):
4444
}
4545

4646
# Create env dict without dataspace
47-
env_dict = {v: test_creds[k] for k, v in ENV_CREDENTIALS.items() if k != "dataspace"}
48-
47+
env_dict = {
48+
v: test_creds[k] for k, v in ENV_CREDENTIALS.items() if k != "dataspace"
49+
}
50+
4951
with patch.dict(os.environ, env_dict, clear=True):
5052
creds = Credentials.from_env()
5153

@@ -121,7 +123,7 @@ def test_from_available_env(self):
121123
"client_id": "test_client_id",
122124
"client_secret": "test_secret",
123125
"login_url": "https://test.login.url",
124-
"dataspace": "test_dataspace", # Added dataspace
126+
"dataspace": "test_dataspace",
125127
}
126128

127129
with (
@@ -137,7 +139,7 @@ def test_from_available_env(self):
137139
assert creds.client_id == test_creds["client_id"]
138140
assert creds.client_secret == test_creds["client_secret"]
139141
assert creds.login_url == test_creds["login_url"]
140-
assert creds.dataspace == test_creds["dataspace"] # Added dataspace assertion
142+
assert creds.dataspace == test_creds["dataspace"]
141143

142144
def test_from_available_ini(self):
143145
"""Test that from_available uses INI file when env vars not available."""

tests/test_credentials_profile_integration.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def test_query_api_reader_with_custom_profile(self):
3232
mock_credentials.password = "custom_password"
3333
mock_credentials.client_id = "custom_client_id"
3434
mock_credentials.client_secret = "custom_secret"
35-
mock_credentials.dataspace = "custom_dataspace" # Added dataspace
35+
mock_credentials.dataspace = "custom_dataspace"
3636
mock_from_available.return_value = mock_credentials
3737

3838
# Mock the SalesforceCDPConnection
@@ -50,14 +50,15 @@ def test_query_api_reader_with_custom_profile(self):
5050
# Verify the correct profile was used
5151
mock_from_available.assert_called_with(profile="custom_profile")
5252

53-
# Verify the connection was created with the custom credentials including dataspace
53+
# Verify the connection was created
54+
# with the custom credentials including dataspace
5455
mock_conn_class.assert_called_once_with(
5556
"https://custom.salesforce.com",
5657
"custom@example.com",
5758
"custom_password",
5859
"custom_client_id",
5960
"custom_secret",
60-
dataspace="custom_dataspace", # Added dataspace parameter
61+
dataspace="custom_dataspace",
6162
)
6263

6364
def test_query_api_reader_without_dataspace(self):
@@ -92,14 +93,14 @@ def test_query_api_reader_without_dataspace(self):
9293
# Verify the correct profile was used
9394
mock_from_available.assert_called_with(profile="custom_profile")
9495

95-
# Verify the connection was created WITHOUT dataspace parameter when None
96+
# Verify the connection was created
97+
# WITHOUT dataspace parameter when None
9698
mock_conn_class.assert_called_once_with(
9799
"https://custom.salesforce.com",
98100
"custom@example.com",
99101
"custom_password",
100102
"custom_client_id",
101103
"custom_secret",
102-
# No dataspace parameter when None
103104
)
104105

105106
def test_print_writer_with_custom_profile(self):

0 commit comments

Comments
 (0)