Exemple #1
0
 def test_call(self):
     f = Mock()
     f2 = Mock()
     chute = Chute.create(f)()
     chute.to(Chute.create(f2)())
     chute()
     assert f.called
     assert f2.called
Exemple #2
0
 def test_call(self):
     f = Mock()
     f2 = Mock()
     chute = Chute.create(f)()
     chute.to(Chute.create(f2)())
     chute()
     assert f.called
     assert f2.called
Exemple #3
0
 def test_to_with_unintialized_chute(self):
     chute = Chute.create(Mock())()
     cb = Chute.create(Mock())
     chute.to(cb)
     assert chute.callbacks
     assert isinstance(chute.callbacks[0], cb)
Exemple #4
0
 def test_rshift(self):
     chute = Chute.create(Mock())()
     cb = Chute.create(Mock())()
     result = chute >> cb
     assert result is cb
     assert cb in chute.callbacks
Exemple #5
0
 def test_to(self):
     chute = Chute.create(Mock())()
     cb = Chute.create(Mock())()
     result = chute.to(cb)
     assert result is cb
     assert cb in chute.callbacks
Exemple #6
0
 def test_callbacks(self):
     f = Mock()
     chute = Chute.create(f)()
     assert chute.callbacks == []
     chute.callbacks.append("foo")
     assert "foo" in chute.callbacks
Exemple #7
0
 def test_runs(self):
     f = Mock(returns=["path/to/file.ufo"])
     chute = Chute.create(f)()
     assert chute.run([]) == ["path/to/file.ufo"]
Exemple #8
0
 def test_init(self):
     f = Mock()
     chute = Chute.create(f)()
     assert not f.called
     assert len(chute.callbacks) == 0
Exemple #9
0
 def test_to_with_unintialized_chute(self):
     chute = Chute.create(Mock())()
     cb = Chute.create(Mock())
     chute.to(cb)
     assert chute.callbacks
     assert isinstance(chute.callbacks[0], cb)
Exemple #10
0
 def test_rshift(self):
     chute = Chute.create(Mock())()
     cb = Chute.create(Mock())()
     result = chute >> cb
     assert result is cb
     assert cb in chute.callbacks
Exemple #11
0
 def test_to(self):
     chute = Chute.create(Mock())()
     cb = Chute.create(Mock())()
     result = chute.to(cb)
     assert result is cb
     assert cb in chute.callbacks
Exemple #12
0
 def test_callbacks(self):
     f = Mock()
     chute = Chute.create(f)()
     assert chute.callbacks == []
     chute.callbacks.append("foo")
     assert "foo" in chute.callbacks
Exemple #13
0
 def test_runs(self):
     f = Mock(returns=["path/to/file.ufo"])
     chute = Chute.create(f)()
     assert chute.run([]) == ["path/to/file.ufo"]
Exemple #14
0
 def test_init(self):
     f = Mock()
     chute = Chute.create(f)()
     assert not f.called
     assert len(chute.callbacks) == 0