コード例 #1
0
 def test_run(self):
     f = Mock()
     task = Task('foo')
     task.start_chain(Chute.create(f)())
     task.run()
     assert f.called
     assert f.args == ([],)
コード例 #2
0
ファイル: test_task.py プロジェクト: hellboxpy/hellbox
 def test_run(self):
     f = Mock()
     task = Task("foo")
     task << Chute.create(f)()
     task.run()
     assert f.called
     assert f.args == ([],)
コード例 #3
0
 def test_run_task(self):
     f = Mock()
     task = Task('foobaz')
     task.start_chain(Chute.create(f)())
     Hellbox.add_task(task)
     Hellbox.run_task('foobaz')
     assert f.called
コード例 #4
0
ファイル: test_hellbox.py プロジェクト: hellboxpy/hellbox
 def test_run_task_with_requirements(self):
     f = Mock()
     f2 = Mock()
     task = Task("fooqaaz")
     task.requires("foobar")
     task << Chute.create(f)()
     task2 = Task("foobar")
     task2 << Chute.create(f2)()
     Hellbox.add_task(task)
     Hellbox.add_task(task2)
     Hellbox.run_task("fooqaaz")
     assert f2.called
コード例 #5
0
ファイル: test_hellbox.py プロジェクト: hellboxpy/hellbox
 def test_run_task_with_requirements(self):
     f = Mock()
     f2 = Mock()
     task = Task("fooqaaz")
     task.requires("foobar")
     task << Chute.create(f)()
     task2 = Task("foobar")
     task2 << Chute.create(f2)()
     Hellbox.add_task(task)
     Hellbox.add_task(task2)
     Hellbox.run_task("fooqaaz")
     assert f2.called
コード例 #6
0
ファイル: test_hellbox.py プロジェクト: hellboxpy/hellbox
 def test_run_task(self):
     f = Mock()
     task = Task("foobaz")
     task << Chute.create(f)()
     Hellbox.add_task(task)
     Hellbox.run_task("foobaz")
     assert f.called
コード例 #7
0
 def test_run_task_with_requirements(self):
     f = Mock()
     f2 = Mock()
     task = Task('fooqaaz')
     task.requires('foobar')
     task.start_chain(Chute.create(f)())
     task2 = Task('foobar')
     task2.start_chain(Chute.create(f2)())
     Hellbox.add_task(task)
     Hellbox.add_task(task2)
     Hellbox.run_task('fooqaaz')
     assert f2.called
コード例 #8
0
ファイル: test_hellbox.py プロジェクト: hellboxpy/hellbox
    def test_usage(self):
        task = Task("build")
        task.describe("Does the building")
        task << Bar(2, grade=3) >> Foo()
        task << Foo() >> Bar(level=2)
        Hellbox.add_task(task)

        task = Task("package")
        task.describe("Does the packaging\nZips and tars")
        task << Foo()
        Hellbox.add_task(task)

        assert Hellbox.usage() == USAGE
コード例 #9
0
ファイル: test_hellbox.py プロジェクト: hellboxpy/hellbox
    def test_usage(self):
        task = Task("build")
        task.describe("Does the building")
        task << Bar(2, grade=3) >> Foo()
        task << Foo() >> Bar(level=2)
        Hellbox.add_task(task)

        task = Task("package")
        task.describe("Does the packaging\nZips and tars")
        task << Foo()
        Hellbox.add_task(task)

        assert Hellbox.usage() == USAGE
コード例 #10
0
 def __init__(self, task_name, *args, **kwargs):
     self.task = Task(task_name)
コード例 #11
0
ファイル: test_task.py プロジェクト: hellboxpy/hellbox
 def test_init(self):
     assert Task("foo").name == "foo"
コード例 #12
0
ファイル: test_task.py プロジェクト: hellboxpy/hellbox
 def test_describe(self):
     task = Task("foo")
     task.describe("something")
     assert task.description == "something"
コード例 #13
0
 def test_open(self):
     task = Task('foo')
     chute = task.read('*.ufo')
     assert isinstance(chute, Chute)
     assert chute in task.chains
コード例 #14
0
ファイル: test_task.py プロジェクト: hellboxpy/hellbox
 def test_write(self):
     task = Task("foo")
     chute = task.write("ufo")
     assert isinstance(chute, Chute)
コード例 #15
0
ファイル: test_task.py プロジェクト: hellboxpy/hellbox
 def test_open(self):
     task = Task("foo")
     chute = task.read("*.ufo")
     assert isinstance(chute, Chute)
     assert chute in task.chains
コード例 #16
0
 def test_write(self):
     task = Task('foo')
     chute = task.write('ufo')
     assert isinstance(chute, Chute)
コード例 #17
0
ファイル: test_hellbox.py プロジェクト: hellboxpy/hellbox
 def test_find_task_by_name(self):
     Hellbox.add_task(Task("foo"))
     assert Hellbox.find_task_by_name("foo")
コード例 #18
0
 def test_describe(self):
     task = Task('foo')
     task.describe('something')
     assert task.description is 'something'