Chris Jerdonek added the comment:

It still seems like things could be made more DRY.  Also, the pattern of having 
assert_unix_browser() execute various function blocks depending on whether 
various arguments are not None doesn't seem as clean or scalable as it should 
be (e.g. if the number of assert statements were to grow).

What about defining helper methods like check_open(), check_open_new_tab(), and 
check_open_new(), and then having the various test_<browser>() methods call 
each of them as appropriate?  For example--

+        browser.open_new('http://www.example.com/')
+        args = popen.cmd_line
+        self.assertEqual(args, ['test', '-raise', '-remote',
+            'openURL(http://www.example.com/,new-window)'])

could become a call to check_open_new().  The helper methods could default to 
the most common string arguments so that you will only need to define and pass 
the string arguments when the browser uses strings that are different from the 
defaults.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue15557>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to