def test_version(self): """ Tests return server version from znc --version """ mock = MagicMock(return_value="ZNC 1.2 - http://znc.in") with patch.dict(znc.__salt__, {"cmd.run": mock}): self.assertEqual(znc.version(), "ZNC 1.2")
def test_version(self): ''' Tests return server version from znc --version ''' mock = MagicMock(return_value='ZNC 1.2 - http://znc.in') with patch.dict(znc.__salt__, {'cmd.run': mock}): self.assertEqual(znc.version(), 'ZNC 1.2')