예제 #1
0
파일: ipset_test.py 프로젝트: DaveQB/salt
 def test_version(self):
     '''
     Test for Return version from ipset --version
     '''
     with patch.object(ipset, '_ipset_cmd', return_value='A'):
         mock = MagicMock(return_value="A\nB\nC")
         with patch.dict(ipset.__salt__, {'cmd.run': mock}):
             self.assertEqual(ipset.version(), 'B')
예제 #2
0
파일: test_ipset.py 프로젝트: vindir/salt
 def test_version(self):
     '''
     Test for Return version from ipset --version
     '''
     with patch.object(ipset, '_ipset_cmd', return_value='A'):
         mock = MagicMock(return_value="A\nB\nC")
         with patch.dict(ipset.__salt__, {'cmd.run': mock}):
             self.assertEqual(ipset.version(), 'B')
예제 #3
0
def test_version():
    """
    Test for Return version from ipset --version
    """
    with patch.object(ipset, "_ipset_cmd", return_value="A"):
        mock = MagicMock(return_value="A\nB\nC")
        with patch.dict(ipset.__salt__, {"cmd.run": mock}):
            assert ipset.version() == "B"