def test_get(): """ Tests the return of get function """ mock_cmd = MagicMock(return_value="foo") with patch.dict(mac_sysctl.__salt__, {"cmd.run": mock_cmd}): assert mac_sysctl.get("kern.ostype") == "foo"
def test_get(self): ''' Tests the return of get function ''' mock_cmd = MagicMock(return_value='foo') with patch.dict(mac_sysctl.__salt__, {'cmd.run': mock_cmd}): self.assertEqual(mac_sysctl.get('kern.ostype'), 'foo')