You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by ke...@apache.org on 2020/11/02 21:27:58 UTC

[allura] 07/15: [#8378] fix zip tests

This is an automated email from the ASF dual-hosted git repository.

kentontaylor pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/allura.git

commit 8674a89bc34b68dd39f02786851afda452014203
Author: Dave Brondsema <da...@brondsema.net>
AuthorDate: Thu Oct 8 17:28:35 2020 -0400

    [#8378] fix zip tests
---
 Allura/allura/tests/test_tasks.py     | 2 +-
 Allura/allura/tests/unit/test_repo.py | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/Allura/allura/tests/test_tasks.py b/Allura/allura/tests/test_tasks.py
index bacf6c1..7c73399 100644
--- a/Allura/allura/tests/test_tasks.py
+++ b/Allura/allura/tests/test_tasks.py
@@ -650,7 +650,7 @@ class TestExportTasks(unittest.TestCase):
         temp = '/tmp/bulk_export/p/test/test'
         zipfn = '/tmp/bulk_export/p/test/test.zip'
         zipdir.assert_called_with(temp, zipfn)
-        shutil.rmtree.assert_called_once_with(temp)
+        shutil.rmtree.assert_called_once_with(six.ensure_binary(temp))
         # check notification
         tasks = M.MonQTask.query.find(
             dict(task_name='allura.tasks.mail_tasks.sendsimplemail')).all()
diff --git a/Allura/allura/tests/unit/test_repo.py b/Allura/allura/tests/unit/test_repo.py
index 4000461..61bae24 100644
--- a/Allura/allura/tests/unit/test_repo.py
+++ b/Allura/allura/tests/unit/test_repo.py
@@ -258,14 +258,14 @@ class TestZipDir(unittest.TestCase):
         zipfile = '/fake/zip/file.tmp'
         zipdir(src, zipfile)
         popen.assert_called_once_with(
-            ['/bin/zip', '-y', '-q', '-r', zipfile, 'repo'],
+            ['/bin/zip', '-y', '-q', '-r', zipfile, b'repo'],
             cwd='/fake/path/to', stdout=PIPE, stderr=PIPE)
         popen.reset_mock()
         src = '/fake/path/to/repo/'
         zipdir(src, zipfile, exclude='file.txt')
         popen.assert_called_once_with(
             ['/bin/zip', '-y', '-q', '-r',
-             zipfile, 'repo', '-x', 'file.txt'],
+             zipfile, b'repo', '-x', 'file.txt'],
             cwd='/fake/path/to', stdout=PIPE, stderr=PIPE)
 
     @patch('allura.model.repository.Popen')
@@ -281,7 +281,7 @@ class TestZipDir(unittest.TestCase):
         emsg = str(cm.exception)
         self.assertIn(
             "Command: " +
-            ("['/bin/zip', '-y', '-q', '-r', '/fake/zip/file.tmp', 'repo'] " if six.PY3 else
+            ("['/bin/zip', '-y', '-q', '-r', '/fake/zip/file.tmp', b'repo'] " if six.PY3 else
              "[u'/bin/zip', u'-y', u'-q', u'-r', u'/fake/zip/file.tmp', 'repo'] ") +
             "returned non-zero exit code 1", emsg)
         self.assertTrue("STDOUT: 1" in emsg)