• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python facilities.load_file_to_todolist函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中test.facilities.load_file_to_todolist函数的典型用法代码示例。如果您正苦于以下问题:Python load_file_to_todolist函数的具体用法?Python load_file_to_todolist怎么用?Python load_file_to_todolist使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: test_group11

    def test_group11(self):
        config(p_overrides={('sort', 'group_string'): 'project'})
        todolist = load_file_to_todolist("test/data/ListCommandGroupTest.txt")

        command = ListCommand(["test:test_group1"], todolist, self.out, self.error)
        command.execute()

        self.assertFalse(todolist.dirty)

        self.assertEqual(self.output, """\
Project: A
==========
|  1| +A only test:test_group1
|  3| +A and +B test:test_group1

Project: B
==========
|  3| +A and +B test:test_group1
|  2| +B only test:test_group1

Project: None
=============
|  4| No project test:test_group1
""")
        self.assertEqual(self.errors, "")
开发者ID:rcraggs,项目名称:topydo,代码行数:25,代码来源:test_list_command.py


示例2: test_group8

    def test_group8(self):
        todolist = load_file_to_todolist("test/data/ListCommandGroupTest.txt")

        command = ListCommand(["-x", "-g", "project,desc:context", "test_group8"], todolist, self.out, self.error)
        command.execute()

        self.assertFalse(todolist.dirty)

        self.assertEqual(self.output, """\
Project: A, Context: B
======================
| 15| Inner sort 2 +A @B test:test_group8

Project: A, Context: A
======================
| 14| Inner sort 1 +A @A test:test_group8

Project: B, Context: B
======================
| 17| Inner sort 4 +B @B test:test_group8

Project: B, Context: A
======================
| 16| Inner sort 3 +B @A test:test_group8
""")
开发者ID:rcraggs,项目名称:topydo,代码行数:25,代码来源:test_list_command.py


示例3: test_contexts1

    def test_contexts1(self):
        todolist = load_file_to_todolist("test/data/TodoListTest.txt")
        command = ListContextCommand([""], todolist, self.out, self.error)
        command.execute()

        self.assertEqual(self.output, "Context1\nContext2\n")
        self.assertFalse(self.errors)
开发者ID:rameshg87,项目名称:topydo,代码行数:7,代码来源:test_list_context_command.py


示例4: test_projects2

    def test_projects2(self):
        todolist = load_file_to_todolist("test/data/TodoListTest.txt")
        command = ListProjectCommand(["aaa"], todolist, self.out, self.error)
        command.execute()

        self.assertEqual(self.output, "Project1\nProject2\n")
        self.assertFalse(self.errors)
开发者ID:MinchinWeb,项目名称:topydo,代码行数:7,代码来源:test_list_project_command.py


示例5: test_projects1

    def test_projects1(self):
        todolist = load_file_to_todolist("test/data/TodoListTest.txt")
        command = ListProjectCommand([""], todolist, self.out, self.error)
        command.execute()
        command.execute_post_archive_actions()  # test default implementation of post_archive

        self.assertEqual(self.output, "Project1\nProject2\n")
        self.assertFalse(self.errors)
开发者ID:rcraggs,项目名称:topydo,代码行数:8,代码来源:test_list_project_command.py


示例6: test_sort14

    def test_sort14(self):
        sorter = Sorter('desc:importance-average')

        todolist = load_file_to_todolist('test/data/SorterTest10.txt')
        view = todolist.view(sorter, [])
        result = load_file('test/data/SorterTest10-result.txt')

        self.assertEqual(print_view(view), todolist_to_string(result))
开发者ID:rameshg87,项目名称:topydo,代码行数:8,代码来源:test_sorter.py


示例7: test_filter07

    def test_filter07(self):
        """ Tests the dependency filter. """
        todolist = load_file_to_todolist('test/data/FilterTest2.txt')
        depfilter = Filter.DependencyFilter(todolist)

        filtered_todos = depfilter.filter(todolist.todos())
        reference = load_file('test/data/FilterTest2-result.txt')

        self.assertEqual(todolist_to_string(filtered_todos),
                         todolist_to_string(reference))
开发者ID:rcraggs,项目名称:topydo,代码行数:10,代码来源:test_filter.py


示例8: test_list22

    def test_list22(self):
        """ Handle tag lists with spaces and punctuation."""
        config(p_overrides={("ls", "hide_tags"): "p, id"})
        self.todolist = load_file_to_todolist("test/data/ListCommandTagTest.txt")

        command = ListCommand(["-x"], self.todolist, self.out, self.error)
        command.execute()

        self.assertFalse(self.todolist.dirty)
        self.assertEqual(self.output, "|  1| Foo.\n")
开发者ID:MinchinWeb,项目名称:topydo,代码行数:10,代码来源:test_list_command.py


示例9: test_list22

    def test_list22(self):
        """ Handle tag lists with spaces and punctuation."""
        config(p_overrides={('ls', 'hide_tags'): 'p, id'})
        self.todolist = load_file_to_todolist('test/data/ListCommandTagTest.txt')

        command = ListCommand(["-x"], self.todolist, self.out, self.error)
        command.execute()

        self.assertFalse(self.todolist.is_dirty())
        self.assertEqual(self.output, '|  1| Foo.\n')
开发者ID:rameshg87,项目名称:topydo,代码行数:10,代码来源:test_list_command.py


示例10: test_group10

    def test_group10(self):
        todolist = load_file_to_todolist("test/data/ListCommandGroupTest.txt")

        command = ListCommand(["-x", "-g"], todolist, self.out, self.error)
        command.execute()

        self.assertFalse(todolist.dirty)

        self.assertEqual(self.output, "")
        self.assertEqual(self.errors, "option -g requires argument\n")
开发者ID:rcraggs,项目名称:topydo,代码行数:10,代码来源:test_list_command.py


示例11: test_sort16

    def test_sort16(self):
        """
        Check sort of low priority tasks (D or lower) with non-priority tasks.
        """
        sorter = Sorter('desc:importance,desc:prio')

        todolist = load_file_to_todolist('test/data/SorterTest12.txt')
        view = todolist.view(sorter, [])
        result = load_file('test/data/SorterTest12-result.txt')

        self.assertEqual(print_view(view), todolist_to_string(result))
开发者ID:rameshg87,项目名称:topydo,代码行数:11,代码来源:test_sorter.py


示例12: test_archive

    def test_archive(self):
        todolist = load_file_to_todolist("test/data/ArchiveCommandTest.txt")
        archive = TodoList([])

        command = ArchiveCommand(todolist, archive)
        command.execute()

        self.assertTrue(todolist.is_dirty())
        self.assertTrue(archive.is_dirty())
        self.assertEqual(todolist.print_todos(), "x Not complete\n(C) Active")
        self.assertEqual(archive.print_todos(), "x 2014-10-19 Complete\nx 2014-10-20 Another one complete")
开发者ID:rameshg87,项目名称:topydo,代码行数:11,代码来源:test_archive_command.py


示例13: test_list46

    def test_list46(self, mock_terminal_size):
        """Test basic 'N' parameter with zero height terminal."""
        # we still print at least 1 item
        mock_terminal_size.return_value = self.terminal_size(100, 0)
        self.todolist = load_file_to_todolist("test/data/ListCommand_50_items.txt")

        command = ListCommand(["-N"], self.todolist, self.out, self.error)
        command.execute()

        self.assertEqual(self.output, "|  1| (A) item 1\n")
        self.assertEqual(self.errors, "")
开发者ID:rameshg87,项目名称:topydo,代码行数:11,代码来源:test_list_command.py


示例14: test_sort15

    def test_sort15(self):
        """
        Test that own importance is used when average turns out to be
        lower.
        """
        sorter = Sorter('desc:importance-average')

        todolist = load_file_to_todolist('test/data/SorterTest11.txt')
        view = todolist.view(sorter, [])
        result = load_file('test/data/SorterTest11-result.txt')

        self.assertEqual(print_view(view), todolist_to_string(result))
开发者ID:rameshg87,项目名称:topydo,代码行数:12,代码来源:test_sorter.py


示例15: test_list44

    def test_list44(self, mock_terminal_size):
        """
        Test 'N' parameter with output longer than available terminal lines.
        """
        self.todolist = load_file_to_todolist("test/data/ListCommand_50_items.txt")
        mock_terminal_size.return_value = self.terminal_size(80, 23)

        command = ListCommand(["-N"], self.todolist, self.out, self.error)
        command.execute()

        self.assertEqual(self.output, "|  1| (A) item 1\n| 27| (A) item 27\n|  2| (B) item 2\n| 28| (B) item 28\n|  3| (C) item 3\n| 29| (C) item 29\n|  4| (D) item 4\n| 30| (D) item 30\n|  5| (E) item 5\n| 31| (E) item 31\n|  6| (F) item 6\n| 32| (F) item 32\n|  7| (G) item 7\n| 33| (G) item 33\n|  8| (H) item 8\n| 34| (H) item 34\n|  9| (I) item 9\n| 35| (I) item 35\n| 10| (J) item 10\n| 36| (J) item 36\n| 11| (K) item 11\n")
        self.assertEqual(self.errors, "")
开发者ID:rameshg87,项目名称:topydo,代码行数:12,代码来源:test_list_command.py


示例16: test_list45

    def test_list45(self, mock_terminal_size):
        """Test basic 'N' parameter with nine line terminal."""
        # have 9 lines on the terminal will print 7 items and leave 2 lines
        # for the next prompt
        mock_terminal_size.return_value = self.terminal_size(100, 9)
        self.todolist = load_file_to_todolist("test/data/ListCommand_50_items.txt")

        command = ListCommand(["-N"], self.todolist, self.out, self.error)
        command.execute()

        self.assertEqual(self.output, "|  1| (A) item 1\n| 27| (A) item 27\n|  2| (B) item 2\n| 28| (B) item 28\n|  3| (C) item 3\n| 29| (C) item 29\n|  4| (D) item 4\n")
        self.assertEqual(self.errors, "")
开发者ID:rameshg87,项目名称:topydo,代码行数:12,代码来源:test_list_command.py


示例17: test_group6

    def test_group6(self):
        todolist = load_file_to_todolist("test/data/ListCommandGroupTest.txt")

        command = ListCommand(["-x", "-g", "fake", "test_group6"], todolist, self.out, self.error)
        command.execute()

        self.assertFalse(todolist.dirty)

        self.assertEqual(self.output, """\
fake: No value
==============
| 11| Group by non-existing tag test:test_group6
""")
开发者ID:rcraggs,项目名称:topydo,代码行数:13,代码来源:test_list_command.py


示例18: test_group4

    def test_group4(self):
        todolist = load_file_to_todolist("test/data/ListCommandGroupTest.txt")

        command = ListCommand(["-g", "t", "test:test_group4"], todolist, self.out, self.error)
        command.execute()

        self.assertFalse(todolist.dirty)

        self.assertEqual(self.output, """\
t: today
========
|  9| Test 1 test:test_group4 test:test_group5 t:2016-12-06
""")
开发者ID:rcraggs,项目名称:topydo,代码行数:13,代码来源:test_list_command.py


示例19: test_ical_unicode

    def test_ical_unicode(self):
        todolist = load_file_to_todolist("test/data/ListCommandUnicodeTest.txt")

        command = ListCommand(["-f", "ical"], todolist, self.out, self.error)
        command.execute()

        self.assertTrue(todolist.dirty)

        icaltext = ""
        with codecs.open("test/data/ListCommandUnicodeTest.ics", "r", encoding="utf-8") as ical:
            icaltext = ical.read()

        self.assertEqual(replace_ical_tags(self.output), replace_ical_tags(icaltext))
        self.assertEqual(self.errors, "")
开发者ID:MinchinWeb,项目名称:topydo,代码行数:14,代码来源:test_list_command.py


示例20: test_group9

    def test_group9(self):
        todolist = load_file_to_todolist("test/data/ListCommandGroupTest.txt")

        command = ListCommand(["-x", "-g", "project", "-s", "desc:text", "test_group9"], todolist, self.out, self.error)
        command.execute()

        self.assertFalse(todolist.dirty)

        self.assertEqual(self.output, """\
Project: A
==========
| 19| Inner sort 2 +A test:test_group9
| 18| Inner sort 1 +A test:test_group9
""")
开发者ID:rcraggs,项目名称:topydo,代码行数:14,代码来源:test_list_command.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python fixture.build_input函数代码示例发布时间:2022-05-27
下一篇:
Python facilities.load_file函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap