Example #1
0
def setupLibrary(env):
    #Setup Library
    print('\n======= Welcome to %s. Library is open till %s =======' %
          (libraryInfo["name"], libraryInfo["closeHour"]))

    #Adding books to library's booklist
    for title in bookInfo["titles"]:
        book = Book(env, title, random.randint(1, 3))
        bookList.append(book)

    #Give Info about Books
    print(
        '\nLibrary Books: \n\nTitle\t\t\tAmount\n=============================='
    )
    for book in bookList:
        print('%s\t\t%s' % (book.getTitle(), book.getAmount()))

    print(
        '\n=======================================================================================\n'
    )
Example #2
0
def test_getTitle():
    b0 = Book("Cujo", "King, Stephen", 1981)
    assert b0.getTitle() == "Cujo"
Example #3
0
def main():
    book1 = Book("The Cat in the Hat")
    print(book1.getTitle())
    book1.setAuthor("Dr. Seuss")
    print(book1.getAuthor())