[Pkg-mozext-commits] [requestpolicy] 70/257: [tst][ref] python: use `string.format()`

David Prévot taffit at moszumanska.debian.org
Thu Jan 28 03:19:57 UTC 2016


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository requestpolicy.

commit 055f55a0e9ceb8bf07a199ceef294fc69370291b
Author: Martin Kimmerle <dev at 256k.de>
Date:   Tue Oct 6 13:02:29 2015 +0200

    [tst][ref] python: use `string.format()`
    
    According to the python documentation, `str.format()` should be
    preferred to the `%` formatting. See
    https://docs.python.org/2/library/stdtypes.html#str.format
---
 tests/marionette/tests/policy/test_rule_with_scheme_only.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/tests/marionette/tests/policy/test_rule_with_scheme_only.py b/tests/marionette/tests/policy/test_rule_with_scheme_only.py
index d0796cb..8db7428 100644
--- a/tests/marionette/tests/policy/test_rule_with_scheme_only.py
+++ b/tests/marionette/tests/policy/test_rule_with_scheme_only.py
@@ -83,13 +83,14 @@ class TestRuleWithSchemeOnly(RequestPolicyTestCase):
         # Assertions
         #=======================================================================
         self.assertTrue(iframe_uri.startswith(SCHEME + ":"),
-                        "The iframe's URI starts with scheme '%s'." % SCHEME)
+                        ("The iframe's URI starts with scheme '{}'."
+                         .format(SCHEME)))
 
         matching_requests = filter(lambda r: r["dest"] == iframe_uri,
                                    self.requests.all)
         self.assertEqual(len(matching_requests), 1,
-                         ("There has been exactly one request to '%s'."
-                          % iframe_uri))
+                         ("There has been exactly one request to '{}'."
+                          .format(iframe_uri)))
 
         # Check the decision (allow or deny) on the request
         self.assertEqual(matching_requests[0]["isAllowed"],

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/requestpolicy.git



More information about the Pkg-mozext-commits mailing list