예제 #1
0
def user_test_unit(user_id):
    """Test for getting the user"""
    client = client_test.make_client()
    user = client.user(user_id)
    ok_(isinstance(user, GoodreadsUser))
    eq_(user.gid, user_id)
    ok_(user.user_name)
    # Call other methods
    user.name
    user.link
    user.image_url
    user.small_image_url
    user.list_groups()
    user.owned_books()
    user.read_status()
    user.reviews()
    user.shelves()
예제 #2
0
def user_test_unit(user_id):
    """Test for getting the user"""
    client = client_test.make_client()
    user = client.user(user_id)
    ok_(isinstance(user, GoodreadsUser))
    eq_(user.gid, user_id)
    ok_(user.user_name)
    # Call other methods
    user.name
    user.link
    user.image_url
    user.small_image_url
    user.list_groups()
    user.owned_books()
    user.read_status()
    user.reviews()
    user.shelves()
예제 #3
0
def author_test():
    """Test for getting an author"""
    client = client_test.make_client()
    author = client.author(1406384)
    ok_(isinstance(author, GoodreadsAuthor))
    ok_(isinstance(book, GoodreadsBook) for book in author.books)
    eq_(author.gid, '1406384')
    ok_(author.about)
    ok_(author.name)
    author.born_at
    author.died_at
    author.fans_count
    author.gender
    author.hometown
    author.link
    author.image_url
    author.small_image_url
    author.influences
    author.user
    author.works_count
예제 #4
0
def book_test():
    """Test for getting a book"""
    client = client_test.make_client()
    book = client.book(50)
    ok_(isinstance(book, GoodreadsBook))
    ok_(book.id)
예제 #5
0
def author_test():
    client = client_test.make_client()
    # test author with a single book
    author_test_unit(client, '8566992')
    # author with multiple books
    author_test_unit(client, '1406384')
예제 #6
0
def author_test():
    client = client_test.make_client()
    # test author with a single book
    author_test_unit(client, '8566992')
    # author with multiple books
    author_test_unit(client, '1406384')
예제 #7
0
def book_test():
    client = client_test.make_client()
    # book with a single author
    book_test_unit(client, '11870085')