Re: [gnome-desktop-testing] patch - gedit/gedit_chains.py



Hi Nags,

On Thu, 2009-02-12 at 18:42 -0800, Nagappan A wrote:
> Hello all,
> 
> Looks like the gedit code fails to log the status. Fixed with the
> attached patch.
> 
> Index: gedit/gedit_chains.py
> ===================================================================
> --- gedit/gedit_chains.py    (revision 4)
> +++ gedit/gedit_chains.py    (working copy)
> @@ -6,7 +6,7 @@
>  from time import time, gmtime, strftime
>  
>  from desktoptesting.gnome import GEdit
> -from desktoptesting.check import FileComparison
> +from desktoptesting.check import *

I would prefer moving FAIL/SUCCESS and other "status codes" to something
like desktoptesting.check.StatusCodes and have it imported specifically
instead of a "import *"

>  
>  try:
>  
> @@ -29,15 +29,15 @@
>      elapsed = stop_time - start_time
>      
>      testcheck = FileComparison(oracle, test_file)
> -    check = testcheck.perform_test()
> +    status = testcheck.perform_test()
>  
>      ldtp.log (str(elapsed), 'time')
>      
> -    if check == desktoptesting.check.FAIL:
> +    if status == FAIL:
>          ldtp.log ('Files differ.', 'cause')
>          ldtp.log ('Files differ.', 'error')
>  
> -except ldtp.LdtpExecutionError, msg:
> +except ldtp.LdtpExecutionError:
>      raise
> 
Wouldn't it be better if we abstract ldtp.LdtpExecutionError into
desktoptesting.Exceptions.LdtpExecutionError?

V. Varadhan




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