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")
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')