From: Brian Warner Date: Sat, 2 Aug 2008 02:47:34 +0000 (-0700) Subject: test_cli: remove windows-worrying newlines from test data X-Git-Url: https://git.rkrishnan.org/?a=commitdiff_plain;h=b9f4006b964c6302a3111de9dc2bb562a4f0180a;p=tahoe-lafs%2Ftahoe-lafs.git test_cli: remove windows-worrying newlines from test data --- diff --git a/src/allmydata/test/test_cli.py b/src/allmydata/test/test_cli.py index d7a62e84..b1788653 100644 --- a/src/allmydata/test/test_cli.py +++ b/src/allmydata/test/test_cli.py @@ -260,8 +260,8 @@ class Put(SystemTestMixin, CLITestMixin, unittest.TestCase): d.addCallback(lambda res: self.do_cli("put", stdin=DATA)) def _uploaded(res): (stdout, stderr) = res - self.failUnlessEqual(stderr, - "waiting for file data on stdin..\n200 OK\n") + self.failUnless("waiting for file data on stdin.." in stderr) + self.failUnless("200 OK" in stderr) self.readcap = stdout self.failUnless(self.readcap.startswith("URI:CHK:")) d.addCallback(_uploaded) @@ -289,7 +289,7 @@ class Put(SystemTestMixin, CLITestMixin, unittest.TestCase): abs_fn = os.path.abspath(rel_fn) # we make the file small enough to fit in a LIT file, for speed f = open(rel_fn, "w") - f.write("short file\n") + f.write("short file") f.close() d = self.set_up_nodes() d.addCallback(lambda res: self.do_cli("put", rel_fn)) @@ -320,8 +320,8 @@ class Put(SystemTestMixin, CLITestMixin, unittest.TestCase): rel_fn = os.path.join(self.basedir, "DATAFILE") abs_fn = os.path.abspath(rel_fn) # we make the file small enough to fit in a LIT file, for speed - DATA = "short file\n" - DATA2 = "short file two\n" + DATA = "short file" + DATA2 = "short file two" f = open(rel_fn, "w") f.write(DATA) f.close() @@ -412,8 +412,8 @@ class Put(SystemTestMixin, CLITestMixin, unittest.TestCase): d.addCallback(lambda res: self.do_cli("put", "--mutable", stdin=DATA)) def _created(res): (stdout, stderr) = res - self.failUnlessEqual(stderr, - "waiting for file data on stdin..\n200 OK\n") + self.failUnless("waiting for file data on stdin.." in stderr) + self.failUnless("200 OK" in stderr) self.filecap = stdout self.failUnless(self.filecap.startswith("URI:SSK:")) d.addCallback(_created) @@ -423,8 +423,8 @@ class Put(SystemTestMixin, CLITestMixin, unittest.TestCase): d.addCallback(lambda res: self.do_cli("put", "-", self.filecap, stdin=DATA2)) def _replaced(res): (stdout, stderr) = res - self.failUnlessEqual(stderr, - "waiting for file data on stdin..\n200 OK\n") + self.failUnless("waiting for file data on stdin.." in stderr) + self.failUnless("200 OK" in stderr) self.failUnlessEqual(self.filecap, stdout) d.addCallback(_replaced) d.addCallback(lambda res: self.do_cli("get", self.filecap)) @@ -433,7 +433,7 @@ class Put(SystemTestMixin, CLITestMixin, unittest.TestCase): d.addCallback(lambda res: self.do_cli("put", rel_fn, self.filecap)) def _replaced2(res): (stdout, stderr) = res - self.failUnlessEqual(stderr, "200 OK\n") + self.failUnless("200 OK" in stderr) self.failUnlessEqual(self.filecap, stdout) d.addCallback(_replaced2) d.addCallback(lambda res: self.do_cli("get", self.filecap))