示例#1
0
def test_add_entry():
    title = "avi"
    content = "How are you doing today?"
    password = "******"
    add_entry(content, title, password)
    entry = m.Note.get(m.Note.title == title)
    print(entry)
    assert entry.content == content
示例#2
0
 def test_upload_drive_invalid(self, upload_drive_function):
     title = "avi"
     content = "How are you doing today?"
     password = "******"
     sync = True
     add_entry(content, title, password, sync)
     entry = m.Note.get(m.Note.title == title)
     p_1 = upload_drive(entry.title, entry.content)
     assert not p_1
示例#3
0
def test_view_entry():
    notes.input = lambda t: 'q'
    crypto = Crypto.Crypto()
    title = "found in this world"
    content = "Batman is found!!!"
    password = "******"
    content_1 = crypto.encrypt(content, password)
    password_to_store = crypto.key_to_store(password)
    add_entry(content_1, title, password_to_store)
    entry = m.Note.get(m.Note.title == title)
    flag = view_entry(entry, password)
    assert not flag
示例#4
0
 def test_download_drive_valid(self, upload_drive_function):
     title = "avi"
     content = "How are you doing today?"
     password = "******"
     sync = True
     add_entry(content, title, password, sync)
     entry = m.Note.get(m.Note.title == title)
     dir1 = os.getcwd()
     f = open(os.path.join(os.path.join(dir1, "sync"), title + ".txt"),
              "w+")  # pylint: disable=invalid-name
     f.write(content)
     f.close()
     p_1 = download_drive(entry, entry.title, entry.content, password)
     assert p_1