def test_genrepo(self): ''' Test winrepo.genrepo runner ''' sls_file = os.path.join(self.winrepo_sls_dir, 'wireshark.sls') # Add a winrepo SLS file with salt.utils.files.fopen(sls_file, 'w') as fp_: fp_.write(salt.utils.stringutils.to_str(_WINREPO_SLS)) self.assertEqual(winrepo.genrepo(), _WINREPO_GENREPO_DATA)
def test_genrepo(winrepo_sls, winrepo_genrepo_data, winrepo_sls_dir): """ Test winrepo.genrepo runner """ sls_file = str(winrepo_sls_dir / "wireshark.sls") # Add a winrepo SLS file with salt.utils.files.fopen(sls_file, "w") as fp_: fp_.write(salt.utils.stringutils.to_str(winrepo_sls)) assert winrepo.genrepo() == winrepo_genrepo_data
def test_genrepo(self): ''' Test winrepo.genrepo runner ''' sls_file = os.path.join(self.winrepo_sls_dir, 'wireshark.sls') # Add a winrepo SLS file with open(sls_file, 'w') as fp_: fp_.write(_WINREPO_SLS) with patch.dict( winrepo.__opts__, {'file_roots': {'base': [self.winrepo_dir]}, 'winrepo_dir': self.winrepo_dir, 'extension_modules': self.extmods_dir}): self.assertEqual(winrepo.genrepo(), _WINREPO_GENREPO_DATA)