Fix module.archive tests for win py3

This commit is contained in:
Daniel A. Wozniak 2018-08-27 00:18:27 -07:00
parent ac60fb8190
commit b9c344b7ce
No known key found for this signature in database
GPG key ID: 166B9D2C06C82D61
3 changed files with 21 additions and 13 deletions

View file

@ -68,6 +68,10 @@ class GrainsTargetingTest(ShellCase):
# ping disconnected minion and ensure it times out and returns with correct message
try:
if salt.utils.platform.is_windows():
cmd_str = '-t 1 -G "id:disconnected" test.ping'
else:
cmd_str = '-t 1 -G \'id:disconnected\' test.ping'
ret = ''
for item in self.run_salt('-t 1 -G "id:disconnected" test.ping', timeout=40):
if item != 'disconnected:':

View file

@ -59,25 +59,29 @@ class ArchiveTest(ModuleCase):
# Create source
os.makedirs(self.src)
with salt.utils.fopen(os.path.join(self.src, 'file'), 'w') as theorem:
theorem.write(textwrap.dedent(r'''\
if unicode_filename:
filename = 'file®'
else:
filename = 'file'
with salt.utils.files.fopen(os.path.join(self.src, filename), 'wb') as theorem:
theorem.write(salt.utils.stringutils.to_bytes(textwrap.dedent('''\
Compression theorem of computational complexity theory:
Given a Gödel numbering $φ$ of the computable functions and a
Blum complexity measure $Φ$ where a complexity class for a
boundary function $f$ is defined as
$\mathrm C(f) := \{φ_i \mathbb R^{(1)} | (^ x) Φ_i(x) f(x)\}$.
$\\mathrm C(f) := \\{φ_i \\mathbb R^{(1)} | (^ x) Φ_i(x) f(x)\\}$.
Then there exists a total computable function $f$ so that for
all $i$
$\mathrm{Dom}(φ_i) = \mathrm{Dom}(φ_{f(i)})$
$\\mathrm{Dom}(φ_i) = \\mathrm{Dom}(φ_{f(i)})$
and
$\mathrm C(φ_i) \mathrm{C}(φ_{f(i)})$.
'''))
$\\mathrm C(φ_i) \\mathrm{C}(φ_{f(i)})$.
''')))
# Create destination
os.makedirs(self.dst)
@ -245,7 +249,7 @@ class ArchiveTest(ModuleCase):
# Test create archive
ret = self.run_function('archive.unzip', [self.arch, self.dst])
self.assertTrue(isinstance(ret, list), six.text_type(ret))
self._assert_artifacts_in_ret(ret, unix_sep=True)
self._assert_artifacts_in_ret(ret, unix_sep=True if six.PY2 else False)
self._tear_down()

View file

@ -18,9 +18,9 @@ integration.modules.test_aliases
integration.modules.test_autoruns
integration.modules.test_archive
integration.modules.test_beacons
integration.modules.test_cmdmod
integration.modules.test_config
integration.modules.test_cp
integration.modules.test_cmdmod
integration.modules.test_data
integration.modules.test_disk
integration.modules.test_firewall