def test_print_list_without_title_success(self): notes_list = '''Total found: 2 1 : 01.01.1970 testnote 2 : 01.01.1970 testnote\n''' printList([NoteStub() for _ in xrange(2)]) sys.stdout.seek(0) self.assertEquals(sys.stdout.read(), notes_list)
def test_print_list_without_title_success(self): notes_list = '''Found 2 items 1 : 2004-09-17 2004-09-17 testnote 2 : 2004-09-17 2004-09-17 testnote\n''' printList([NoteStub() for _ in xrange(2)]) sys.stdout.seek(0) self.assertEquals(sys.stdout.read(), notes_list)
def test_print_list_with_title_success(self): notes_list = '''=================== test ================== Found 2 items 1 : 2004-09-16 2004-09-16 testnote 2 : 2004-09-16 2004-09-16 testnote\n''' printList([NoteStub() for _ in range(2)], title='test') sys.stdout.seek(0) self.assertEqual(sys.stdout.read(), notes_list)
def test_print_list_with_urls_success(self): notes_list = '''=================== test ================== Found 2 items 1 : 2004-09-17 2004-09-17 testnote >>> https://www.evernote.com/Home.action?#n=12345 2 : 2004-09-17 2004-09-17 testnote >>> https://www.evernote.com/Home.action?#n=12345 ''' printList([NoteStub() for _ in xrange(2)], title='test', showUrl=True) sys.stdout.seek(0) self.assertEquals(sys.stdout.read(), notes_list)
def test_print_list_with_urls_success(self): notes_list = '''=================== test ================== Total found: 2 1 : 01.01.1970 testnote >>> https://www.evernote.com/Home.action?#n=12345 2 : 01.01.1970 testnote >>> https://www.evernote.com/Home.action?#n=12345 ''' printList([NoteStub() for _ in xrange(2)], title='test', showUrl=True) sys.stdout.seek(0) self.assertEquals(sys.stdout.read(), notes_list)
def test_print_list_with_urls_success(self): notes_list = '''=================== test ================== Found 2 items 1 : 2004-09-17 2004-09-17 testnote >>> https://{url}/Home.action?#n=12345 2 : 2004-09-17 2004-09-17 testnote >>> https://{url}/Home.action?#n=12345 '''.format(url=USER_BASE_URL) printList([NoteStub() for _ in xrange(2)], title='test', showUrl=True) sys.stdout.seek(0) self.assertEquals(sys.stdout.read(), notes_list)
def test_print_list_with_selector_success(self): out.rawInput = lambda x: 2 notes_list = '''=================== test ================== Found 2 items 1 : 2004-09-17 2004-09-17 testnote 2 : 2004-09-17 2004-09-17 testnote 0 : -Cancel-\n''' out.printList([NoteStub() for _ in xrange(2)], title='test', showSelector=True) sys.stdout.seek(0) self.assertEquals(sys.stdout.read(), notes_list)
def test_print_list_with_selector_success(self): out.rawInput = lambda x: 2 notes_list = '''=================== test ================== Total found: 2 1 : 01.01.1970 testnote 2 : 01.01.1970 testnote 0 : -Cancel-\n''' out.printList([NoteStub() for _ in xrange(2)], title='test', showSelector=True) sys.stdout.seek(0) self.assertEquals(sys.stdout.read(), notes_list)