コード例 #1
0
ファイル: utils.py プロジェクト: Qabel/qabel-index
 def test_check(self):
     aa = AccountingAuthorization()
     session = MagicMock()
     token = "Token 1234"
     ok, reason = aa.check(token, session)
     assert not ok
     json = {"auth": token}
     session.post.assert_called_once_with(aa.endpoint_url(), headers=aa.headers(), json=json)
コード例 #2
0
ファイル: utils.py プロジェクト: audax/qabel-index
 def test_check(self):
     aa = AccountingAuthorization()
     session = MagicMock()
     token = 'Token 1234'
     ok, reason = aa.check(token, session)
     assert not ok
     json = {
         'auth': token,
     }
     session.post.assert_called_once_with(aa.endpoint_url(), headers=aa.headers(), json=json)
コード例 #3
0
ファイル: utils.py プロジェクト: audax/qabel-index
 def test_endpoint_url(self, settings):
     aa = AccountingAuthorization()
     settings.ACCOUNTING_URL = 'gopher://accounting.plan9/foo'
     assert aa.endpoint_url() == 'gopher://accounting.plan9/foo/api/v0/internal/user/'
コード例 #4
0
ファイル: utils.py プロジェクト: Qabel/qabel-index
 def test_endpoint_url(self, settings):
     aa = AccountingAuthorization()
     settings.ACCOUNTING_URL = "gopher://accounting.plan9/foo"
     assert aa.endpoint_url() == "gopher://accounting.plan9/foo/api/v0/internal/user/"