当前位置: 首页>>代码示例>>Python>>正文


Python Display.print_uploading方法代码示例

本文整理汇总了Python中display.Display.print_uploading方法的典型用法代码示例。如果您正苦于以下问题:Python Display.print_uploading方法的具体用法?Python Display.print_uploading怎么用?Python Display.print_uploading使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在display.Display的用法示例。


在下文中一共展示了Display.print_uploading方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: DisplayTestCase

# 需要导入模块: from display import Display [as 别名]
# 或者: from display.Display import print_uploading [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)
开发者ID:jackdesert,项目名称:lyxblogger_oo,代码行数:64,代码来源:test_display.py


注:本文中的display.Display.print_uploading方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。