MCPcopy Index your code
hub / github.com/algorithmiaio/algorithmia-python / test_auth_cert

Method test_auth_cert

Test/regular/CLI_test.py:200–220  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

198 self.assertEqual(resultA, api_address)
199
200 def test_auth_cert(self):
201
202 localfile = "./../TestFiles/fakecert.pem"
203
204 testfile = open(localfile, "w")
205 testfile.write("")
206 testfile.close()
207
208 # key for test account
209 key = os.getenv('ALGORITHMIA_API_KEY')
210 address = 'https://api.algorithmia.com'
211 cacert = localfile
212 profile = 'test'
213
214 CLI().auth(address, key, cacert=cacert, profile=profile)
215 resultK = CLI().getAPIkey(profile)
216 resultA = CLI().getAPIaddress(profile)
217 resultC = CLI().getCert(profile)
218 self.assertEqual(resultK, key)
219 self.assertEqual(resultA, address)
220 self.assertEqual(resultC, cacert)
221
222 def test_auth_token(self):
223 address = 'https://api.algorithmia.com'

Callers

nothing calls this directly

Calls 5

CLIClass · 0.90
authMethod · 0.80
getAPIkeyMethod · 0.80
getAPIaddressMethod · 0.80
getCertMethod · 0.80

Tested by

no test coverage detected