Author chris.jerdonek
Recipients anton.barkovsky, chris.jerdonek, georg.brandl, r.david.murray
Date 2012-08-12.16:30:19
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1344789019.95.0.45058736195.issue15557@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2012-08-12 16:30:20chris.jerdoneksetrecipients: + chris.jerdonek, georg.brandl, r.david.murray, anton.barkovsky
2012-08-12 16:30:19chris.jerdoneksetmessageid: <1344789019.95.0.45058736195.issue15557@psf.upfronthosting.co.za>
2012-08-12 16:30:19chris.jerdoneklinkissue15557 messages
2012-08-12 16:30:19chris.jerdonekcreate