Closed Bug 984921 Opened 10 years ago Closed 9 years ago

Replace assertTrue("foo" in bar) in test_navigation.py

Categories

(Remote Protocol :: Marionette, defect)

defect
Not set
normal

Tracking

(firefox40 fixed)

RESOLVED FIXED
mozilla40
Tracking Status
firefox40 --- fixed

People

(Reporter: ato, Assigned: ato)

Details

(Keywords: pi-marionette-server)

Attachments

(2 files, 1 obsolete file)

Tests are currently doing self.assertTrue("foo" in bar) whereas self.assertIn("foo", bar) would be preferable for better debugging when a test fails.
Must be landed after bug 977893.
Assignee: nobody → ato
Status: NEW → ASSIGNED
Attachment #8392968 - Flags: review?(dburns)
Comment on attachment 8392968 [details] [diff] [review]
0001-Bug-984921-Replace-assertTrue-foo-in-bar-in-test_nav.patch

Review of attachment 8392968 [details] [diff] [review]:
-----------------------------------------------------------------

r+ can be carried forward with cleanup of nits

::: testing/marionette/client/marionette/tests/unit/test_navigation.py
@@ +3,4 @@
>  # file, You can obtain one at http://mozilla.org/MPL/2.0/.
>  
>  from marionette_test import MarionetteTestCase
> +from marionette import MarionetteException, TimeoutException

Please put this back to multiple lines

@@ +14,5 @@
> +        self.iframe_doc = self.marionette.absolute_url("test_iframe.html")
> +
> +    def test_set_location_through_execute_script(self):
> +        self.marionette.execute_script(
> +            "window.location.href = '%s'" % self.test_doc)

nit: if we are going to be multilining here it would be better to split around the %. It's better to align with the delimiter if possible

@@ +23,4 @@
>      def test_navigate(self):
> +        self.marionette.navigate(self.test_doc)
> +        self.assertNotEqual("about:blank", self.marionette.execute_script(
> +            "return window.location.href;"))

Nit: as above

also <3 it for looking neater

@@ +73,5 @@
> +        self.assertTrue(self.marionette.execute_script("""
> +        var elem = window.document.createElement('div');
> +        elem.id = 'someDiv';
> +        window.document.body.appendChild(elem);
> +        return true;"""))

If possible can we indent here so it doesnt line up with the python
Attachment #8392968 - Flags: review?(dburns) → review+
Attached file MozReview Request: bz://984921/ato (obsolete) —
/r/6989 - Bug 984921: Clean up Marionette navigation tests

Pull down this commit:

hg pull -r 1844c906cc436ef378f07342051a44689fedba58 https://reviewboard-hg.mozilla.org/gecko/
Attachment #8591248 - Flags: review?(dburns)
Comment on attachment 8591248 [details]
MozReview Request: bz://984921/ato

/r/6989 - Bug 984921: Clean up Marionette navigation tests

Pull down this commit:

hg pull -r 1844c906cc436ef378f07342051a44689fedba58 https://reviewboard-hg.mozilla.org/gecko/
OS: Linux → All
Hardware: x86_64 → All
Comment on attachment 8591248 [details]
MozReview Request: bz://984921/ato

https://reviewboard.mozilla.org/r/6987/#review5781

Ship It!
Attachment #8591248 - Flags: review?(dburns) → review+
https://hg.mozilla.org/mozilla-central/rev/d286935cb11b
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla40
Attachment #8591248 - Attachment is obsolete: true
Attachment #8618098 - Flags: review+
Product: Testing → Remote Protocol
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: