[tor-dev] test_cmdline_args.py on Windows
Justin Findlay
jfindlay at gmail.com
Mon Jan 5 18:08:56 UTC 2015
On 01/05/2015 09:26 AM, Gisle Vanem wrote:
> Gisle Vanem wrote:
>
>> I only get 2 errors in that script. The others like:
>> self.assertTrue(out_verif.endswith("Configuration was valid\n"))
>>
>> needs another patch which is beyond my Python knowledge.
>
> I think it's fine now with this change:
>
> @@ -57,14 +57,14 @@
> raise UnexpectedFailure()
> elif not result and failure:
> raise UnexpectedSuccess()
> - return b2s(output)
> + return b2s(output.replace('\r\n','\n'))
Or even better, try to handle line endings in a platform agnostic
manner. Perhaps you could do instead
- self.assertTrue(out_verif.endswith("Configuration was valid\n"))
+ self.assertTrue(out_verif.rstrip().endswith("Configuration was
valid"))
since there are more line endings than POSIX and windows.
Justin
More information about the tor-dev
mailing list