Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(10)  |  Call(8)  |  Derive(0)  |  Import(2)

src/p/i/pigpy-0.7/tests/test_reports.py   pigpy(Download)
import re
 
from pigpy.reports import Report, Plan
 
class test_reports(unittest.TestCase):
        four = Report("4", "%(this)s", parents={"3": three})
 
        plan = Plan(reports=[three], output_directory="/", save_format="")
        self.failUnless(re.match(".*1.*2.*3.*", plan.pigfile, flags=re.DOTALL),
            "Pigfile should match .*1.*2.*3.*, instead is:\n%s" % plan.pigfile
        five = Report("5", "%(this)s", parents={"3": three})
 
        plan = Plan(reports=[three, four])
        self.failUnless(re.match("(.*1.*2)(.*3.*4.*)|(.*4.*3.*)", plan.pigfile,
            flags=re.DOTALL))
                              "%(this)s=%(parent_report)s", 
                              parents={"parent_report": base_report})
        plan = Plan(reports=[child_report])
 
        self.failUnless("child=my_name" in plan.pigfile,
    def test_reports_in_plan_get_saved(self):
        base_report = Report("not_saved", "some pig code")
        saved_report = Report("saved", "%(this)s = More pig code", parents={"base": base_report})
 
        plan = Plan(reports=[saved_report])

src/p/i/pigpy-0.7/tests/test_helpers.py   pigpy(Download)
import sys
import os
import unittest
from pigpy.reports import Report, Plan
from pigpy.helpers import filter_report
    def test_basic_filter(self):
        basic = Plan(reports=[filter_report(self.report, "$0 == 0")])
        self.assert_("to_filter" in basic.pigfile)
        self.assert_("$0 == 0" in basic.pigfile)