Exemplo n.º 1
0
def test_link_writer2manybooks():
    book1 = wikilib.Book()
    book2 = wikilib.Book()
    smith = wikilib.Writer()
    smith.books.extend([book1, book2])
    assert smith.books and book1 in smith.books and book2 in smith.books
    assert book1.authors and smith in book1.authors
    assert book2.authors and smith in book2.authors
Exemplo n.º 2
0
def test_wikilib_econtents():
    smith = wikilib.Writer()
    book = wikilib.Book()
    lib = wikilib.Library()
    lib.writers.append(smith)
    lib.books.append(book)
    assert smith in lib.eContents
    assert book in lib.eContents
Exemplo n.º 3
0
def test_book_defaultvalue():
    book = wikilib.Book()
    assert book.category is wikilib.BookCategory.ScienceFiction
    assert book.pages == 0
    assert book.title is Ecore.EString.default_value
Exemplo n.º 4
0
def test_link_writer2book():
    book = wikilib.Book()
    smith = wikilib.Writer()
    smith.books.append(book)
    assert smith.books and smith.books[0] is book
    assert book.authors and book.authors[0] is smith
Exemplo n.º 5
0
def test_create_book():
    book = wikilib.Book()
    assert book and isinstance(book, Ecore.EObject)
    assert book.title is None
    assert book.category is wikilib.BookCategory.ScienceFiction