Exemple #1
0
 def test_input_wrapper(self):
     dc = DnstestConfig()
     input_mock = mock.MagicMock()
     if sys.version_info[0] == 3:
         with mock.patch('builtins.input', input_mock):
             dc.input_wrapper("foo")
     else:
         with mock.patch('__builtin__.raw_input', input_mock):
             dc.input_wrapper("foo")
     assert input_mock.call_count == 1
     assert input_mock.call_args == mock.call('foo')
Exemple #2
0
 def test_input_wrapper(self):
     dc = DnstestConfig()
     input_mock = mock.MagicMock()
     if sys.version_info[0] == 3:
         with mock.patch('builtins.input', input_mock):
             dc.input_wrapper("foo")
     else:
         with mock.patch('__builtin__.raw_input', input_mock):
             dc.input_wrapper("foo")
     assert input_mock.call_count == 1
     assert input_mock.call_args == mock.call('foo')