Exemplo n.º 1
0
def test_get_user_returns_with_200_response(phabfactory):
    user_response = phabfactory.user()
    expected_user = first_result_in_response(user_response)
    phid = phid_for_response(user_response)

    phab = PhabricatorClient(api_key='api-key')
    user = phab.get_user(phid)

    assert user == expected_user
Exemplo n.º 2
0
def test_get_user_returns_with_200_response():
    phab = PhabricatorClient(api_key='api-key')
    with requests_mock.mock() as m:
        m.get(phab_url('user.query'), status_code=200, json=CANNED_USER_1)
        user = phab.get_user(phid=CANNED_USER_1['result'][0]['phid'])
        assert user == CANNED_USER_1['result'][0]