From 8c2e739dcd9f9b3408efba21bf3850e63a08752b Mon Sep 17 00:00:00 2001 From: Atul Varma Date: Wed, 24 May 2017 11:52:56 -0400 Subject: [PATCH] Make test_broken_symlink_raises_err resilient across OS's/locales. --- src/wormhole/test/test_cli.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/wormhole/test/test_cli.py b/src/wormhole/test/test_cli.py index c0eca38..ba9cfc1 100644 --- a/src/wormhole/test/test_cli.py +++ b/src/wormhole/test/test_cli.py @@ -85,7 +85,12 @@ class OfferData(unittest.TestCase): self._create_broken_symlink() self.cfg.ignore_unsendable_files = False e = self.assertRaises(UnsendableFileError, build_offer, self.cfg) - self.assertEqual(str(e), "linky: No such file or directory") + + # On english distributions of Linux, this will be + # "linky: No such file or directory", but the error may be + # different on Windows and other locales and/or Unix variants, so + # we'll just assert the part we know about. + self.assertIn("linky: ", str(e)) def test_broken_symlink_is_ignored(self): self._create_broken_symlink()