當前位置: 首頁>>代碼示例>>Python>>正文


Python DepriCommand.DepriCommand類代碼示例

本文整理匯總了Python中topydo.commands.DepriCommand.DepriCommand的典型用法代碼示例。如果您正苦於以下問題:Python DepriCommand類的具體用法?Python DepriCommand怎麽用?Python DepriCommand使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了DepriCommand類的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_invalid1

    def test_invalid1(self):
        command = DepriCommand(["99"], self.todolist, self.out, self.error)
        command.execute()

        self.assertFalse(self.todolist.dirty)
        self.assertFalse(self.output)
        self.assertEqual(self.errors, "Invalid todo number given.\n")
開發者ID:bram85,項目名稱:topydo,代碼行數:7,代碼來源:test_depri_command.py

示例2: test_help

    def test_help(self):
        command = DepriCommand(["help"], self.todolist, self.out, self.error)
        command.execute()

        self.assertEqual(self.output, "")
        self.assertEqual(self.errors,
                         command.usage() + "\n\n" + command.help() + "\n")
開發者ID:bram85,項目名稱:topydo,代碼行數:7,代碼來源:test_depri_command.py

示例3: test_empty

    def test_empty(self):
        command = DepriCommand([], self.todolist, self.out, self.error)
        command.execute()

        self.assertFalse(self.todolist.dirty)
        self.assertFalse(self.output)
        self.assertEqual(self.errors, command.usage() + "\n")
開發者ID:bram85,項目名稱:topydo,代碼行數:7,代碼來源:test_depri_command.py

示例4: test_expr_depri4

    def test_expr_depri4(self):
        """ Don't remove priority from unrelevant todo items. """
        command = DepriCommand(["-e", "Bax"], self.todolist, self.out,
                               self.error, None)
        command.execute()

        self.assertFalse(self.todolist.dirty)
開發者ID:bram85,項目名稱:topydo,代碼行數:7,代碼來源:test_depri_command.py

示例5: test_depri3

    def test_depri3(self):
        command = DepriCommand(["Foo"], self.todolist, self.out, self.error)
        command.execute()

        self.assertTrue(self.todolist.dirty)
        self.assertEqual(self.todolist.todo(1).priority(), None)
        self.assertEqual(self.output, "Priority removed.\n|  1| Foo\n")
        self.assertEqual(self.errors, "")
開發者ID:bram85,項目名稱:topydo,代碼行數:8,代碼來源:test_depri_command.py

示例6: test_depri2

    def test_depri2(self):
        command = DepriCommand(["2"], self.todolist, self.out, self.error)
        command.execute()

        self.assertFalse(self.todolist.dirty)
        self.assertEqual(self.todolist.todo(2).priority(), None)
        self.assertEqual(self.output, "")
        self.assertEqual(self.errors, "")
開發者ID:bram85,項目名稱:topydo,代碼行數:8,代碼來源:test_depri_command.py

示例7: test_invalid3

    def test_invalid3(self):
        command = DepriCommand(["99", "FooBar"], self.todolist, self.out,
                               self.error)
        command.execute()

        self.assertFalse(self.todolist.is_dirty())
        self.assertFalse(self.output)
        self.assertEqual(self.errors, "Invalid todo number given: 99.\nInvalid todo number given: FooBar.\n")
開發者ID:rameshg87,項目名稱:topydo,代碼行數:8,代碼來源:test_depri_command.py

示例8: test_expr_depri5

    def test_expr_depri5(self):
        """ Force unprioritizing unrelevant items with additional -x flag. """
        command = DepriCommand(["-xe", "Bax"], self.todolist, self.out,
                               self.error, None)
        command.execute()

        self.assertTrue(self.todolist.dirty)
        self.assertEqual(self.output, "Priority removed.\n|  6| Bax id:1\n")
        self.assertEqual(self.errors, "")
開發者ID:bram85,項目名稱:topydo,代碼行數:9,代碼來源:test_depri_command.py

示例9: test_expr_depri2

    def test_expr_depri2(self):
        command = DepriCommand(["-e", "@test", "due:2015-06-03"],
                               self.todolist, self.out, self.error, None)
        command.execute()

        result = "Priority removed.\n|  4| a @test with due:2015-06-03\n"

        self.assertTrue(self.todolist.dirty)
        self.assertEqual(self.output, result)
        self.assertEqual(self.errors, "")
開發者ID:bram85,項目名稱:topydo,代碼行數:10,代碼來源:test_depri_command.py

示例10: test_depri4

    def test_depri4(self):
        command = DepriCommand(["1", "Baz"], self.todolist, self.out,
                               self.error)
        command.execute()

        self.assertTrue(self.todolist.is_dirty())
        self.assertEqual(self.todolist.todo(1).priority(), None)
        self.assertEqual(self.todolist.todo(3).priority(), None)
        self.assertEqual(self.output, "Priority removed.\n|  1| Foo\nPriority removed.\n|  3| Baz\n")
        self.assertEqual(self.errors, "")
開發者ID:rameshg87,項目名稱:topydo,代碼行數:10,代碼來源:test_depri_command.py

示例11: test_invalid4

    def test_invalid4(self):
        """
        Throw an error with invalid argument containing special characters.
        """
        command = DepriCommand([u"Fo\u00d3B\u0105r", "Bar"], self.todolist,
                               self.out, self.error, None)
        command.execute()

        self.assertFalse(self.todolist.dirty)
        self.assertFalse(self.output)
        self.assertEqual(self.errors,
                         u"Invalid todo number given: Fo\u00d3B\u0105r.\n")
開發者ID:bram85,項目名稱:topydo,代碼行數:12,代碼來源:test_depri_command.py

示例12: test_expr_depri3

    def test_expr_depri3(self):
        command = DepriCommand(["-e", "@test", "due:2015-06-03", "+project"],
                               self.todolist, self.out, self.error, None)
        command.execute()

        self.assertFalse(self.todolist.dirty)
開發者ID:bram85,項目名稱:topydo,代碼行數:6,代碼來源:test_depri_command.py

示例13: test_depri_name

    def test_depri_name(self):
        name = DepriCommand.name()

        self.assertEqual(name, 'depri')
開發者ID:bram85,項目名稱:topydo,代碼行數:4,代碼來源:test_depri_command.py


注:本文中的topydo.commands.DepriCommand.DepriCommand類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。