Example #1
0
 def test_error(self):
     if sys.version_info < (3, ):
         self.skipTest('Unsupported Mock in Python 2.7')
     m = Mock(side_effect=DirHuntError)
     with patch('sys.stderr.write') as mock_write:
         catch(m)()
         m.assert_called_once()
         mock_write.assert_called_once()
Example #2
0
def main():
    catch(hunt)()
Example #3
0
 def test_ok(self):
     m = Mock()
     catch(m)()
     m.assert_called_once()