コード例 #1
0
 def test_ping(self):
     '''
     Test if it performs a ping to a host.
     '''
     mock = MagicMock(return_value=True)
     with patch.dict(win_network.__salt__, {'cmd.run': mock}):
         self.assertTrue(win_network.ping('127.0.0.1'))
コード例 #2
0
def test_ping():
    """
    Test if it performs a ping to a host.
    """
    mock = MagicMock(return_value=True)
    with patch.dict(win_network.__salt__, {"cmd.run": mock}):
        assert win_network.ping("127.0.0.1")
コード例 #3
0
ファイル: win_network_test.py プロジェクト: dmyerscough/salt
 def test_ping(self):
     '''
     Test if it performs a ping to a host.
     '''
     mock = MagicMock(return_value=True)
     with patch.dict(win_network.__salt__, {'cmd.run': mock}):
         self.assertTrue(win_network.ping('127.0.0.1'))