def test_get_notes(): try: notebook_1 = _get_notebook() result = notebook_1.notes expected = [Note("Test1", "Test1.", ["test1"], color="yellow"), Note("Test2", "Test2.", ["test2"], color="yellow")] assertion = result == expected except Exception as e: print(e) assertion = False assert assertion
def test_reorder_success(): try: notebook = _get_notebook() notebook.reorder([0, 1]) note_1 = Note("Test2", "Test2.", ["test2"], color="yellow") note_2 = Note("Test1", "Test1.", ["test1"], color="yellow") expected = Notebook([note_1, note_2]) assertion = notebook == expected except Exception as e: print(e) assertion = False assert assertion
def test_add_one_note(): try: notebook = _get_notebook() note_1 = Note("Test1", "Test1.", ["test1"], color="yellow") note_2 = Note("Test2", "Test2.", ["test2"], color="yellow") note_3 = Note("Test3", "Test3.", ["test3"], color="yellow") notebook.add_notes(note_3) expected = Notebook([note_1, note_2, note_3]) assertion = notebook == expected except Exception as e: print(e) assertion = False assert assertion
def test_duplicate_error(): try: note = _get_note() result = Note("Test1", "test", ["test"], color="yellow") expected = _get_note() assertion = result != expected except Exception as e: print(e) assertion = False assert assertion
def test_is_eq_error_index(): try: notebook_1 = _get_notebook() notebook_2 = _get_notebook() note_3 = Note("Test3", "Test3.", ["test3"], color="yellow") notebook_2.add_notes(note_3) assertion = notebook_1 != notebook_2 except Exception as e: print(e) assertion = False assert assertion
def test_remove_one_note(): try: notebook = _get_notebook() note_2 = Note("Test2", "Test2.", ["test2"], color="yellow") notebook.remove_notes(0) expected = Notebook([note_2]) assertion = notebook == expected except Exception as e: print(e) assertion = False assert assertion
def test_set_notes(): try: notebook = _get_notebook() note_3 = Note("Test3", "Test3.", ["test3"], color="yellow") notebook.notes = [note_3] result = notebook.tags expected = {"test3"} assertion = result == expected except Exception as e: print(e) assertion = False assert assertion
def test__update_tags(): try: notebook = _get_notebook() note_3 = Note("Test3", "Test3.", ["test3"], color="yellow") notebook.add_notes(note_3) result = notebook.tags expected = {"test1", "test2", "test3"} assertion = result == expected except Exception as e: print(e) assertion = False assert assertion
def _get_note(): note = Note("Test", "test", ["test"], color="yellow") return note
def _get_notebook(): note_1 = Note("Test1", "Test1.", ["test1"], color="yellow") note_2 = Note("Test2", "Test2.", ["test2"], color="yellow") notebook = Notebook([note_1, note_2]) return notebook