本文整理汇总了Python中display.Display.print_done方法的典型用法代码示例。如果您正苦于以下问题:Python Display.print_done方法的具体用法?Python Display.print_done怎么用?Python Display.print_done使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类display.Display
的用法示例。
在下文中一共展示了Display.print_done方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: DisplayTestCase
# 需要导入模块: from display import Display [as 别名]
# 或者: from display.Display import print_done [as 别名]
class DisplayTestCase(unittest.TestCase):
def setUp(self):
self.display = Display()
def test_print_entry_summary(self):
entry = ElyxerEntry()
entry._Entry__images = [Image("<img src='photo.jpg' />")]
entry._Entry__title = 'my title'
entry._Entry__body = 'fine, fine day'
returned = self.display.print_entry_summary(entry)
expected = "You are about to publish:\n\n my title\n 3 words\n 1 image\n"
print '**************************************************************'
print returned
print expected
self.assertEqual(returned, expected)
def test_ask_for_new_password_with_jabber(self):
jabber = Jabber(['test'])
new_display = Display(jabber)
expected = new_display.ask_for_new_password()
self.assertEqual(expected, "test")
def test_ask_for_temp_password_with_jabber(self):
jabber = Jabber(['a temporary password'])
new_display = Display(jabber)
account = Account('hi', 'there', None)
expected = new_display.ask_for_temp_password(account)
self.assertEqual(expected, "a temporary password")
def test_ask_for_new_username_with_jabber(self):
jabber = Jabber(['microgasm'])
new_display = Display(jabber)
expected = new_display.ask_for_new_username()
self.assertEqual(expected, 'microgasm')
def test_ask_which_account_with_jabber(self):
jabber = Jabber(['1300'])
new_display = Display(jabber)
account = Account('url', 'username', 'password')
expected = new_display.ask_which_account([account], 17)
self.assertEqual(expected, '1300')
def test_ask_for_title_with_jabber(self):
jabber = Jabber(['Love Conquers All'])
new_display = Display(jabber)
expected = new_display.ask_for_title()
self.assertEqual(expected, 'Love Conquers All')
def test_ask_for_new_url_with_jabber(self):
jabber = Jabber(['whee.com'])
new_display = Display(jabber)
expected = new_display.ask_for_new_url()
self.assertEqual(expected, 'whee.com')
def test_print_accounts(self):
account = Account('url', 'username', 'password')
account.set_section_id(1)
expected = "ACCOUNTS\nEnter the number next to the desired account.\n(**latest) N = New, D = Delete\n1. [email protected] **"
result = self.display._Display__print_accounts([account], 1, False)
self.assertEqual(result, expected)
def test_welcome(self):
self.assertEqual(self.display.welcome('33'), 'LyXBlogger 33')
def test_print_done(self):
self.assertEqual(self.display.print_done(), 'Done')
def test_print_uploading(self):
account = Account('hi.com', 'mister-t', None)
expected = "Uploading to hi.com"
returned = self.display.print_uploading(account)
self.assertEqual(expected, returned)