dulwich-users team mailing list archive
-
dulwich-users team
-
Mailing list archive
-
Message #00416
[PATCH 2/2] blackbox: strip EOL
Tests were breaking on Windows due to EOL difference.
Note: this is just a quick-fix; for multi-line messages, things may get
dirty.
---
I'm not sure if there's a better way of handling EOL in Python - perhaps
line.rstrip() for line in process.stderr.readlines()
?
dulwich/tests/test_blackbox.py | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/dulwich/tests/test_blackbox.py b/dulwich/tests/test_blackbox.py
index 0762ab6..e1e9031 100644
--- a/dulwich/tests/test_blackbox.py
+++ b/dulwich/tests/test_blackbox.py
@@ -45,8 +45,10 @@ class GitReceivePackTests(BlackboxTestCase):
def test_missing_arg(self):
process = self.run_command("dul-receive-pack", [])
+ # this may get messy with longer messages
(stdout, stderr) = process.communicate()
- self.assertEquals('usage: dul-receive-pack <git-dir>\n', stderr)
+ stderr = stderr.rstrip()
+ self.assertEquals('usage: dul-receive-pack <git-dir>', stderr)
self.assertEquals('', stdout)
self.assertEquals(1, process.returncode)
@@ -61,7 +63,9 @@ class GitUploadPackTests(BlackboxTestCase):
def test_missing_arg(self):
process = self.run_command("dul-upload-pack", [])
+ # this may get messy with longer messages
(stdout, stderr) = process.communicate()
- self.assertEquals('usage: dul-upload-pack <git-dir>\n', stderr)
+ stderr = stderr.rstrip()
+ self.assertEquals('usage: dul-upload-pack <git-dir>', stderr)
self.assertEquals('', stdout)
self.assertEquals(1, process.returncode)
--
1.7.3.2.msysgit.0
Follow ups
References