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


Python facilities.load_file函数代码示例

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


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

示例1: test_filter31

    def test_filter31(self):
        todos = load_file('test/data/FilterTest3.txt')
        otf = Filter.OrdinalTagFilter('value:>-8')

        filtered_todos = otf.filter(todos)
        reference = load_file('test/data/FilterTest13-result.txt')

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

示例2: test_filter16

    def test_filter16(self):
        todos = load_file('test/data/FilterTest1.txt')
        grep = Filter.NegationFilter(Filter.GrepFilter('+project'))

        filtered_todos = grep.filter(todos)
        reference = load_file('test/data/FilterTest3-result.txt')

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

示例3: test_filter20

    def test_filter20(self):
        todos = load_file('test/data/FilterTest3.txt')
        otf = Filter.OrdinalTagFilter('due:<2014-11-10')

        filtered_todos = otf.filter(todos)
        reference = load_file('test/data/FilterTest6-result.txt')

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

示例4: test_filter08

    def test_filter08(self):
        """ Test case sensitive match (forced, with lowercase). """
        todos = load_file('test/data/FilterTest1.txt')
        grep = Filter.GrepFilter('+Project', False)

        filtered_todos = grep.filter(todos)
        reference = load_file('test/data/FilterTest1a-result.txt')

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

示例5: test_filter05

    def test_filter05(self):
        """ Test case sensitive match. """
        todos = load_file('test/data/FilterTest1.txt')
        grep = Filter.GrepFilter('+Project')

        filtered_todos = grep.filter(todos)
        reference = load_file('test/data/FilterTest1b-result.txt')

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

示例6: test_filter18

    def test_filter18(self):
        todos = load_file('test/data/FilterTest1.txt')
        grep1 = Filter.GrepFilter('part')
        grep2 = Filter.GrepFilter('important')
        grep = Filter.OrFilter(grep1, grep2)

        filtered_todos = grep.filter(todos)
        reference = load_file('test/data/FilterTest5-result.txt')

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

示例7: test_filter17

    def test_filter17(self):
        todos = load_file('test/data/FilterTest1.txt')
        grep1 = Filter.GrepFilter('task')
        grep2 = Filter.GrepFilter('project')
        andfilter = Filter.AndFilter(grep1, grep2)

        filtered_todos = andfilter.filter(todos)
        reference = load_file('test/data/FilterTest4-result.txt')

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

示例8: sort_file

    def sort_file(self, p_filename, p_filename_ref, p_sorter):
        """
        Sorts a file and compares it with a reference result.
        Also check that the sort algorithm hasn't touched the original data.
        """
        todos = load_file(p_filename)
        text_before = todolist_to_string(todos)
        todos_sorted = todolist_to_string(p_sorter.sort(todos))
        todos_ref = todolist_to_string(load_file(p_filename_ref))

        self.assertEqual(todos_sorted, todos_ref)
        self.assertEqual(todolist_to_string(todos), text_before)
开发者ID:rameshg87,项目名称:topydo,代码行数:12,代码来源:test_sorter.py

示例9: test_filter23

    def test_filter23(self):
        todos = load_file('test/data/FilterTest3.txt')
        otf = Filter.OrdinalTagFilter('due:=2014-11-99')

        filtered_todos = otf.filter(todos)

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

示例10: test_filter28

    def test_filter28(self):
        todos = load_file('test/data/FilterTest3.txt')
        otf = Filter.OrdinalTagFilter('value:<16a')

        filtered_todos = otf.filter(todos)

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

示例11: test_filter09

    def test_filter09(self):
        """ Test instance filter. """
        todos = load_file('test/data/FilterTest1.txt')
        instance_filter = Filter.InstanceFilter(todos[2:])

        filtered_todos = instance_filter.filter(todos)

        self.assertEqual(todos[2:], filtered_todos)
开发者ID:rcraggs,项目名称:topydo,代码行数:8,代码来源:test_filter.py

示例12: test_filter15

    def test_filter15(self):
        """ Test limit filter. """
        todos = load_file('test/data/FilterTest1.txt')
        limit_filter = Filter.LimitFilter(100)

        filtered_todos = limit_filter.filter(todos)

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

示例13: test_filter14

    def test_filter14(self):
        """ Test limit filter. """
        todos = load_file('test/data/FilterTest1.txt')
        limit_filter = Filter.LimitFilter(-1)

        filtered_todos = limit_filter.filter(todos)

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

示例14: 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

示例15: 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


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