def test_setenv(self): """ Set multiple salt process environment variables from a dict. Returns a dict. """ mock_environ = {"KEY": "value"} with patch.dict(os.environ, mock_environ): self.assertFalse(environ.setenv("environ")) with patch.dict(os.environ, mock_environ): self.assertFalse(environ.setenv({"A": True}, False, True, False)) with patch.dict(os.environ, mock_environ): mock_setval = MagicMock(return_value=None) with patch.object(environ, "setval", mock_setval): self.assertEqual(environ.setenv({}, False, True, False)["KEY"], None)
def test_setenv(self): """ Set multiple salt process environment variables from a dict. Returns a dict. """ mock_environ = {"key": "value"} with patch.dict(os.environ, mock_environ): self.assertFalse(environ.setenv("environ")) with patch.dict(os.environ, mock_environ): self.assertFalse(environ.setenv({"A": True}, False, True, False)) with patch.dict(os.environ, mock_environ): mock_setval = MagicMock(return_value=None) with patch.object(environ, "setval", mock_setval): self.assertEqual(environ.setenv({}, False, True, False)["key"], None)
def test_setenv(self): ''' Set multiple salt process environment variables from a dict. Returns a dict. ''' mock_environ = {'KEY': 'value'} with patch.dict(os.environ, mock_environ): self.assertFalse(environ.setenv('environ')) with patch.dict(os.environ, mock_environ): self.assertFalse(environ.setenv({'A': True}, False, True, False)) with patch.dict(os.environ, mock_environ): mock_setval = MagicMock(return_value=None) with patch.object(environ, 'setval', mock_setval): self.assertEqual( environ.setenv({}, False, True, False)['KEY'], None)
def test_setenv(self): ''' Set multiple salt process environment variables from a dict. Returns a dict. ''' mock_environ = {'key': 'value'} with patch.dict(os.environ, mock_environ): self.assertFalse(environ.setenv('environ')) with patch.dict(os.environ, mock_environ): self.assertFalse(environ.setenv({'A': True}, False, True, False)) with patch.dict(os.environ, mock_environ): mock_setval = MagicMock(return_value=None) with patch.object(environ, 'setval', mock_setval): self.assertEqual(environ.setenv({}, False, True, False)['key'], None)