示例#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)
示例#2
0
 def test_calls_with_args(self, cc):
     scaffold.call(('yes', 'please'))
     cc.assert_called_with(('yes', 'please'))
示例#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')
示例#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)
示例#5
0
 def test_calls_with_args(self, cc):
     scaffold.call(('yes', 'please'))
     cc.assert_called_with(('yes', 'please'))
示例#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')