コード例 #1
0
ファイル: allPythonContent.py プロジェクト: Mondego/pyreco
def test_unauthenticated_request():
    """
  Should return a 403 if request does not provide a valid api key
  """
    response = app.get("/v1/users/abcdef", status=403)
    assert response.body == "403 Missing required parameters"

    test.reset_datastore()
コード例 #2
0
def test_unauthenticated_request():
  """
  Should return a 403 if request does not provide a valid api key
  """
  response = app.get("/v1/users/abcdef", status=403)
  assert response.body == "403 Missing required parameters"

  test.reset_datastore()
コード例 #3
0
ファイル: allPythonContent.py プロジェクト: Mondego/pyreco
def test_verify_existing_user():
    """
  Should return 200
  """
    user = users.User("*****@*****.**")
    account = Account(user=user)
    account.set_hash_and_key()
    account.put()

    response = app.get("/v1/users/%s?api_key=%s" % (account.hash, account.api_key), status=200)

    assert response.body == "200 OK"

    test.reset_datastore()
コード例 #4
0
ファイル: allPythonContent.py プロジェクト: Mondego/pyreco
def test_verify_non_existing_user():
    """
  Should return a 404 if userhash does not have a Notify.io account
  """
    user = users.User("*****@*****.**")
    account = Account(user=user)
    account.set_hash_and_key()
    account.put()

    response = app.get("/v1/users/abcdef?api_key=%s" % account.api_key, status=404)

    assert response.body == "404 User not found"

    test.reset_datastore()
コード例 #5
0
def test_verify_non_existing_user():
  """
  Should return a 404 if userhash does not have a Notify.io account
  """
  user = users.User("*****@*****.**")
  account = Account(user=user)
  account.set_hash_and_key()
  account.put()

  response = app.get("/v1/users/abcdef?api_key=%s" % account.api_key, status=404)

  assert response.body == "404 User not found"

  test.reset_datastore()
コード例 #6
0
def test_verify_existing_user():
  """
  Should return 200
  """
  user = users.User("*****@*****.**")
  account = Account(user=user)
  account.set_hash_and_key()
  account.put()

  response = app.get("/v1/users/%s?api_key=%s" % (account.hash,
    account.api_key), status=200)

  assert response.body == "200 OK"

  test.reset_datastore()