예제 #1
0
 def test_version(self):
     """
     Test if it return version from iptables --version
     """
     mock = MagicMock(return_value="iptables v1.4.21")
     with patch.dict(iptables.__salt__, {"cmd.run": mock}):
         self.assertEqual(iptables.version(), "v1.4.21")
예제 #2
0
 def test_version(self):
     '''
     Test if it return version from iptables --version
     '''
     mock = MagicMock(return_value='iptables v1.4.21')
     with patch.dict(iptables.__salt__, {'cmd.run': mock}):
         self.assertEqual(iptables.version(), 'v1.4.21')
예제 #3
0
 def test_version(self):
     '''
     Test if it return version from iptables --version
     '''
     mock = MagicMock(return_value='iptables v1.4.21')
     with patch.dict(iptables.__salt__, {'cmd.run': mock}):
         self.assertEqual(iptables.version(), 'v1.4.21')