예제 #1
0
def test_accounts_with_id():
    responses.add(responses.GET,
                  with_resource('/1/accounts/2iqph'),
                  body=with_fixture('accounts_load'),
                  content_type='application/json')

    client = Client(characters(40), characters(40), characters(40),
                    characters(40))

    account = client.accounts('2iqph')
    assert account is not None
    assert isinstance(account, Account)
    assert account.id == '2iqph'
예제 #2
0
def test_accounts_with_no_id():
    responses.add(responses.GET,
                  with_resource('/1/accounts'),
                  body=with_fixture('accounts_all'),
                  content_type='application/json')

    client = Client(characters(40), characters(40), characters(40),
                    characters(40))

    cursor = client.accounts()
    assert cursor is not None
    assert isinstance(cursor, Cursor)
    assert cursor.count == 5
def test_accounts_with_id():
    responses.add(responses.GET, with_resource('/1/accounts/2iqph'),
                                 body=with_fixture('accounts_load'),
                                 content_type='application/json')

    client = Client(
        characters(40),
        characters(40),
        characters(40),
        characters(40)
    )

    account = client.accounts('2iqph')
    assert account is not None
    assert isinstance(account, Account)
    assert account.id == '2iqph'
def test_accounts_with_no_id():
    responses.add(responses.GET, with_resource('/1/accounts'),
                                 body=with_fixture('accounts_all'),
                                 content_type='application/json')

    client = Client(
        characters(40),
        characters(40),
        characters(40),
        characters(40)
    )

    cursor = client.accounts()
    assert cursor is not None
    assert isinstance(cursor, Cursor)
    assert cursor.count == 5