コード例 #1
0
def notekeeper():
    nk = NoteKeeper()
    nk._clippings = {
        1: Clip("book1", "author1", 1, 1, datetime.min, ""),
        2: Clip("book2", "author2", 1, 1, datetime.min, ""),
    }
    nk._bookclip_map = {"book1": {1}, "book2": {2}}
    return nk
コード例 #2
0
def test_extract_book_title(input, expected):
    names = NoteKeeper._extract_book_title(input)
    assert names == expected
コード例 #3
0
def test_extract_author(input, expected):
    names = NoteKeeper._extract_author(input)
    assert names == expected
コード例 #4
0
def test_swap_parts_of_name(input, expected):
    names = NoteKeeper._swap_parts_of_name(input)
    assert names == expected
コード例 #5
0
def test_extract_clip(input, expected):
    clip = NoteKeeper._extract_clip(input)
    assert clip == expected
コード例 #6
0
def test_extract_date(input, expected_date):
    date = NoteKeeper._extract_date(input)
    assert date == expected_date
コード例 #7
0
def test_extract_location(input, expected_start, expected_end):
    start, end = NoteKeeper._extract_location(input)
    assert start == expected_start
    assert end == expected_end
コード例 #8
0
def notekeeper():
    return NoteKeeper()