Exemplo n.º 1
0
 def test_exits_on_error(self, cc):
     with patch.object(scaffold.sys, 'exit') as exiter:
         cc.side_effect = subprocess.CalledProcessError(None, None)
         scaffold.call(('oh' 'noes'))
         exiter.assert_called_with(1)
Exemplo n.º 2
0
 def test_calls_with_args(self, cc):
     scaffold.call(('yes', 'please'))
     cc.assert_called_with(('yes', 'please'))
Exemplo n.º 3
0
 def test_writes_message(self, cc):
     with patch.object(scaffold, 'write'):
         scaffold.call(('yes', 'please'))
         scaffold.write.assert_called_with('Calling: yes please')
Exemplo n.º 4
0
 def test_exits_on_error(self, cc):
     with patch.object(scaffold.sys, 'exit') as exiter:
         cc.side_effect = subprocess.CalledProcessError(None, None)
         scaffold.call(('oh' 'noes'))
         exiter.assert_called_with(1)
Exemplo n.º 5
0
 def test_calls_with_args(self, cc):
     scaffold.call(('yes', 'please'))
     cc.assert_called_with(('yes', 'please'))
Exemplo n.º 6
0
 def test_writes_message(self, cc):
     with patch.object(scaffold, 'write'):
         scaffold.call(('yes', 'please'))
         scaffold.write.assert_called_with('Calling: yes please')