Update winrepo tests with new param names

This commit is contained in:
Erik Johnson 2015-08-09 21:19:45 -05:00
parent 01a2742f72
commit 18ebdd382a
2 changed files with 10 additions and 10 deletions

View File

@ -36,14 +36,14 @@ class WinRepoTestCase(TestCase):
@patch('salt.loader.render', MagicMock(return_valu=''))
def test_genrepo(self):
'''
Test to generate win_repo_cachefile
based on sls files in the win_repo
Test to generate winrepo_cachefile based on sls files in the
winrepo_dir
'''
with patch.dict(win_repo.__opts__, {'win_repo': 'c:\\salt'}):
with patch.dict(win_repo.__opts__, {'winrepo_dir': 'c:\\salt'}):
mock_bool = MagicMock(return_value=True)
with patch.object(os.path, 'exists', mock_bool):
with patch.dict(win_repo.__opts__,
{'win_repo_cachefile': 'cache.c'}):
{'winrepo_cachefile': 'cache.c'}):
mock = MagicMock(return_value={})
with patch.object(os, 'walk', mock):
with patch('salt.utils.fopen', mock_open()):
@ -53,11 +53,11 @@ class WinRepoTestCase(TestCase):
def test_update_git_repos(self):
'''
Test to checkout git repos containing
Windows Software Package Definitions
Test to checkout git repos containing Windows software package
definitions
'''
with patch.dict(win_repo.__opts__, {'win_repo': 'c:\\salt'}):
with patch.dict(win_repo.__opts__, {'win_gitrepos': {}}):
with patch.dict(win_repo.__opts__, {'winrepo_dir': 'c:\\salt'}):
with patch.dict(win_repo.__opts__, {'winrepo_remotes': {}}):
mock = MagicMock(return_value=True)
with patch.object(salt.output, 'display_output', mock):
self.assertDictEqual(win_repo.update_git_repos(), {})

View File

@ -73,8 +73,8 @@ class WinrepoTestCase(TestCase):
ret.update({'comment': 'missing /srv/salt/win/repo'})
self.assertDictEqual(winrepo.genrepo('salt'), ret)
mock = MagicMock(return_value={'win_repo': 'salt',
'win_repo_mastercachefile': 'abc'})
mock = MagicMock(return_value={'winrepo_dir': 'salt',
'winrepo_cachefile': 'abc'})
with patch.object(salt.config, 'master_config', mock):
mock = MagicMock(return_value=[0, 1, 2, 3, 4, 5, 6, 7, 8])
with patch.object(os, 'stat', mock):