def test_w_linux(self): m = self._set_up_test_w_linux() w_output = 'root pts/1 13:42 0s 0.24s 0.16s nmap -sV 10.2.2.2' with patch.dict(status.__grains__, {'kernel': 'Linux'}): with patch.dict(status.__salt__, {'cmd.run': MagicMock(return_value=w_output)}): ret = status.w() self.assertListEqual(ret, m.ret)
def test_w_bsd(self): m = self._set_up_test_w_bsd() w_output = 'root p1 10.2.2.1 1:42PM 0 nmap -sV 10.2.2.2' for bsd in ['Darwin', 'FreeBSD', 'OpenBSD']: with patch.dict(status.__grains__, {'kernel': bsd}): with patch.dict(status.__salt__, {'cmd.run': MagicMock(return_value=w_output)}): ret = status.w() self.assertListEqual(ret, m.ret)
def test_w_bsd(self): m = self._set_up_test_w_bsd() w_output = "root p1 10.2.2.1 1:42PM 0 nmap -sV 10.2.2.2" for bsd in ["Darwin", "FreeBSD", "OpenBSD"]: with patch.dict(status.__grains__, {"kernel": bsd}): with patch.dict(status.__salt__, {"cmd.run": MagicMock(return_value=w_output)}): ret = status.w() self.assertListEqual(ret, m.ret)