[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [tor-dev] test_cmdline_args.py on Windows



Thanks; applied!

On Mon, Jan 5, 2015 at 1:08 PM, Justin Findlay <jfindlay@xxxxxxxxx> wrote:
> 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
> _______________________________________________
> tor-dev mailing list
> tor-dev@xxxxxxxxxxxxxxxxxxxx
> https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-dev
_______________________________________________
tor-dev mailing list
tor-dev@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-dev