Skip to content

Commit

Permalink
Merge pull request #970 from thomasyu888/SYNPY-1269-fix-integration-t…
Browse files Browse the repository at this point in the history
…ests

[SYNPY-1269] Edit synapse config file to use auth token and edit tests
  • Loading branch information
thomasyu888 committed Jun 5, 2023
2 parents 1611b11 + 7d5c222 commit 5d8827f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Binary file modified test.synapseConfig.enc
Binary file not shown.
10 changes: 8 additions & 2 deletions tests/integration/synapseclient/integration_test.py
Expand Up @@ -22,8 +22,11 @@ def test_login(syn):
try:
config = configparser.RawConfigParser()
config.read(client.CONFIG_FILE)
username = config.get('authentication', 'username')
password = config.get('authentication', 'password')
# keep password authentication tests until fully deprecated
# Added a section in the synapse config
username = config.get('oldAuthentication', 'username')
password = config.get('oldAuthentication', 'password')
authtoken = config.get('authentication', 'authtoken')
sessionToken = syn._getSessionToken(username, password)

syn.logout(forgetMe=True)
Expand All @@ -45,6 +48,9 @@ def test_login(syn):
# Login with ID only from config file
syn.login(username, silent=True)

# Login with auth token
syn.login(authToken=authtoken, silent=True)

# Login with ID not matching username
pytest.raises(SynapseNoCredentialsError, syn.login, "fakeusername")

Expand Down

0 comments on commit 5d8827f

Please sign in to comment.