)]}'
{"test-requirements.txt":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"9629abe143edd0decd10cdac2c2b2a8a81b008cd","unresolved":false,"context_lines":[{"line_number":6,"context_line":"sphinx\u003e\u003d1.1.2,\u003c1.2"},{"line_number":7,"context_line":"testrepository\u003e\u003d0.0.18"},{"line_number":8,"context_line":"oslotest\u003e\u003d1.10.0  # Apache-2.0"},{"line_number":9,"context_line":"requests-mock\u003e\u003d1.1  # Apache-2.0"}],"source_content_type":"text/plain","patch_set":4,"id":"fa6399be_b5ef77af","line":9,"updated":"2016-10-11 03:58:48.000000000","message":"both of these new depends do seem to be needed - all of the provisioning documentation and tools I\u0027m aware of say to install using test-requirements.txt tho - so we can probably just blast something to the dev ML to give folks that have hand spun saio\u0027s a heads up\n\nI don\u0027t know anything about either of these libaries fwiw.  I got the following versions from pypi\n\nrequests-mock\u003d\u003d1.1.0\noslotest\u003d\u003d2.10.0\n\n... and this change seems to work with them.","commit_id":"b5907d7d7ad3d127ccbb3f9b172d65ec3bf7e84f"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"03711bba8976f6eab773915f6a236df2e6043e07","unresolved":false,"context_lines":[{"line_number":5,"context_line":"oslosphinx\u003e\u003d4.7.0  # Apache-2.0"},{"line_number":6,"context_line":"sphinx\u003e\u003d1.1.2,\u003c1.2"},{"line_number":7,"context_line":"testrepository\u003e\u003d0.0.18"},{"line_number":8,"context_line":"oslotest\u003e\u003d1.10.0  # Apache-2.0"},{"line_number":9,"context_line":"requests-mock\u003e\u003d1.1  # Apache-2.0"}],"source_content_type":"text/plain","patch_set":5,"id":"fa6399be_ceb50ece","line":8,"updated":"2016-10-11 22:06:53.000000000","message":"there is a *lot* going on here:\n\nhttps://github.com/openstack/oslotest/blob/master/oslotest/base.py\n\n... might take some time to digest; might be easier to swallow adding this one in some context of removing duplicated behavior from existing test infrastructure.","commit_id":"35c82a041beb4d19a8da2103d7b1302b920268ed"},{"author":{"_account_id":7191,"name":"Jamie Lennox","email":"jamielennox@gmail.com","username":"jamielennox"},"change_message_id":"025b96eb607d37cc74fd0d4238692fd503fd0457","unresolved":false,"context_lines":[{"line_number":5,"context_line":"oslosphinx\u003e\u003d4.7.0  # Apache-2.0"},{"line_number":6,"context_line":"sphinx\u003e\u003d1.1.2,\u003c1.2"},{"line_number":7,"context_line":"testrepository\u003e\u003d0.0.18"},{"line_number":8,"context_line":"oslotest\u003e\u003d1.10.0  # Apache-2.0"},{"line_number":9,"context_line":"requests-mock\u003e\u003d1.1  # Apache-2.0"}],"source_content_type":"text/plain","patch_set":5,"id":"fa6399be_1f82d294","line":8,"in_reply_to":"fa6399be_ceb50ece","updated":"2016-10-12 00:28:44.000000000","message":"Sure, i\u0027m happy to make this testtools which is a well known and accept part of the python infrastructure. I probably tried to move a bit quick assuming an oslo dependency, it\u0027s just what other projects typically use.","commit_id":"35c82a041beb4d19a8da2103d7b1302b920268ed"}],"tests/unit/test_swiftclient.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"03711bba8976f6eab773915f6a236df2e6043e07","unresolved":false,"context_lines":[{"line_number":791,"context_line":"                                \u0027token\u0027, \u0027container\u0027)"},{"line_number":792,"context_line":"        self.assertEqual(resp[\u0027x-container-meta-color\u0027], \u0027blue\u0027)"},{"line_number":793,"context_line":"        self.assertEqual("},{"line_number":794,"context_line":"            b\u0027token\u0027, self.requests_mock.last_request.headers[\u0027X-Auth-Token\u0027])"},{"line_number":795,"context_line":""},{"line_number":796,"context_line":"    def test_server_error(self):"},{"line_number":797,"context_line":"        body \u003d b\u0027c\u0027 * 60"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa6399be_abab6c88","line":794,"updated":"2016-10-11 22:06:53.000000000","message":"years of working with mocks has made me shy of assertions that validate the \"last\" request/call/etc without also validating it was the *only* one.\n\nwould something like this be idiomatic:\n\nself.assertEqual(1, self.requests_mock.call_count)\nself.assertEqual(... some value on last_request ...)","commit_id":"35c82a041beb4d19a8da2103d7b1302b920268ed"},{"author":{"_account_id":7191,"name":"Jamie Lennox","email":"jamielennox@gmail.com","username":"jamielennox"},"change_message_id":"025b96eb607d37cc74fd0d4238692fd503fd0457","unresolved":false,"context_lines":[{"line_number":791,"context_line":"                                \u0027token\u0027, \u0027container\u0027)"},{"line_number":792,"context_line":"        self.assertEqual(resp[\u0027x-container-meta-color\u0027], \u0027blue\u0027)"},{"line_number":793,"context_line":"        self.assertEqual("},{"line_number":794,"context_line":"            b\u0027token\u0027, self.requests_mock.last_request.headers[\u0027X-Auth-Token\u0027])"},{"line_number":795,"context_line":""},{"line_number":796,"context_line":"    def test_server_error(self):"},{"line_number":797,"context_line":"        body \u003d b\u0027c\u0027 * 60"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa6399be_ff227eb8","line":794,"in_reply_to":"fa6399be_abab6c88","updated":"2016-10-12 00:28:44.000000000","message":"Yep, we can do that. The other thing that was recently added was called_once so: \n\nself.assertTrue(self.requests_mock.called_once)\n\nAs the maintainer of requests-mock i\u0027d also be interested in anything you think is clearer. For example:\n\nself.requests_mock.all_called or all_called_once \n\nto ensure that every mock that has been registered has been called (once, or 1+). Off the top of my head this might have to be named differently because when you provide a response_list you probably want the mock called for every entry in the response list.\n\nThis could then be called on addCleanup in the way the current mocks are validated.","commit_id":"35c82a041beb4d19a8da2103d7b1302b920268ed"},{"author":{"_account_id":7191,"name":"Jamie Lennox","email":"jamielennox@gmail.com","username":"jamielennox"},"change_message_id":"5243ee834f3ebf99f384872383e98572332d5231","unresolved":false,"context_lines":[{"line_number":791,"context_line":"                                \u0027token\u0027, \u0027container\u0027)"},{"line_number":792,"context_line":"        self.assertEqual(resp[\u0027x-container-meta-color\u0027], \u0027blue\u0027)"},{"line_number":793,"context_line":"        self.assertEqual("},{"line_number":794,"context_line":"            b\u0027token\u0027, self.requests_mock.last_request.headers[\u0027X-Auth-Token\u0027])"},{"line_number":795,"context_line":""},{"line_number":796,"context_line":"    def test_server_error(self):"},{"line_number":797,"context_line":"        body \u003d b\u0027c\u0027 * 60"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa6399be_75d5ad41","line":794,"in_reply_to":"fa6399be_ff227eb8","updated":"2016-10-12 01:11:08.000000000","message":"Oh, also part of the reason this works is that if a request is made for a url that does not have a response registered then requests_mock raises an exception. So just by the fact that the tests are passing you have a fair degree of confidence that you are hitting the right urls.","commit_id":"35c82a041beb4d19a8da2103d7b1302b920268ed"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"03711bba8976f6eab773915f6a236df2e6043e07","unresolved":false,"context_lines":[{"line_number":1048,"context_line":""},{"line_number":1049,"context_line":"        self.assertEqual(b\u0027tToken\u0027, history[2].headers[\u0027X-Auth-Token\u0027])"},{"line_number":1050,"context_line":"        self.assertEqual(b\u0027bytes\u003d4-\u0027, history[2].headers[\u0027range\u0027])"},{"line_number":1051,"context_line":"        self.assertEqual(b\u0027some etag\u0027, history[2].headers[\u0027if-match\u0027])"},{"line_number":1052,"context_line":""},{"line_number":1053,"context_line":"    def test_chunk_size_iter_retry_no_range_support(self):"},{"line_number":1054,"context_line":"        self.requests_mock.get(\u0027http://auth.url/asdf/asdf\u0027,"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa6399be_eba3a49c","line":1051,"updated":"2016-10-11 22:06:53.000000000","message":"Is there a reasonable way to perform an absolute assertion on a list of expected request matchers?  mock has the generic \"call\" objects?\n\nself.assertEqual(m.call_args_list, [mock.call(*args1), mock.call(*args2)]","commit_id":"35c82a041beb4d19a8da2103d7b1302b920268ed"},{"author":{"_account_id":7191,"name":"Jamie Lennox","email":"jamielennox@gmail.com","username":"jamielennox"},"change_message_id":"025b96eb607d37cc74fd0d4238692fd503fd0457","unresolved":false,"context_lines":[{"line_number":1048,"context_line":""},{"line_number":1049,"context_line":"        self.assertEqual(b\u0027tToken\u0027, history[2].headers[\u0027X-Auth-Token\u0027])"},{"line_number":1050,"context_line":"        self.assertEqual(b\u0027bytes\u003d4-\u0027, history[2].headers[\u0027range\u0027])"},{"line_number":1051,"context_line":"        self.assertEqual(b\u0027some etag\u0027, history[2].headers[\u0027if-match\u0027])"},{"line_number":1052,"context_line":""},{"line_number":1053,"context_line":"    def test_chunk_size_iter_retry_no_range_support(self):"},{"line_number":1054,"context_line":"        self.requests_mock.get(\u0027http://auth.url/asdf/asdf\u0027,"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa6399be_9af3500a","line":1051,"in_reply_to":"fa6399be_eba3a49c","updated":"2016-10-12 00:28:44.000000000","message":"So the information is all there it\u0027s just a matter of how we want to test it. At the requests-mock layer we don\u0027t want to absolutely assert the headers because requests itself will add things like Accept, Content-Length and other stuff that may change over time. \n\nHowever it would be trivial to make a local assertRequests clone taking method, path, body, headers and ensuring the list length is the same and the history matches the expected. \n\nI\u0027d need to consider whether this is something I would want to support in requests-mock or just handle in swiftclient, but the code is simple.","commit_id":"35c82a041beb4d19a8da2103d7b1302b920268ed"}],"tests/unit/utils.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"9629abe143edd0decd10cdac2c2b2a8a81b008cd","unresolved":false,"context_lines":[{"line_number":397,"context_line":"        # to some unfortunate test order dependency bugs by way of the broken"},{"line_number":398,"context_line":"        # window theory if any other modules are similarly patched"},{"line_number":399,"context_line":"        self.capture_output.__exit__()"},{"line_number":400,"context_line":"        reload_module(c)"},{"line_number":401,"context_line":""},{"line_number":402,"context_line":""},{"line_number":403,"context_line":"class CaptureStreamPrinter(object):"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa6399be_75f6bfd8","line":400,"updated":"2016-10-11 03:58:48.000000000","message":"I think this reload line got disconnected from it\u0027s comment - but this is talking about *exactly* what this change is meant to address.\n\nunfortunately I get a bunch of test failures if I try to pull this out - so all of the coupling is still there....","commit_id":"b5907d7d7ad3d127ccbb3f9b172d65ec3bf7e84f"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"03711bba8976f6eab773915f6a236df2e6043e07","unresolved":false,"context_lines":[{"line_number":200,"context_line":"    return connect"},{"line_number":201,"context_line":""},{"line_number":202,"context_line":""},{"line_number":203,"context_line":"class TestCase(base.BaseTestCase):"},{"line_number":204,"context_line":""},{"line_number":205,"context_line":"    def setUp(self):"},{"line_number":206,"context_line":"        super(TestCase, self).setUp()"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa6399be_aefe1a69","line":203,"updated":"2016-10-11 22:06:53.000000000","message":"I have a strong preference to just use testtools.TestCase here\n\n    diff --git a/tests/unit/utils.py b/tests/unit/utils.py\n    index 4b9c79a..eb6c6e7 100644\n    --- a/tests/unit/utils.py\n    +++ b/tests/unit/utils.py\n    @@ -17,11 +17,11 @@ import functools\n     import sys\n     from time import sleep\n     \n    -from oslotest import base\n     from requests import RequestException\n     from requests.structures import CaseInsensitiveDict\n     from requests_mock.contrib import fixture\n     import unittest\n    +import testtools\n     import mock\n     import six\n     from six.moves import reload_module\n    @@ -200,7 +200,7 @@ def fake_http_connect(*code_iter, **kwargs):\n         return connect\n     \n     \n    -class TestCase(base.BaseTestCase):\n    +class TestCase(testtools.TestCase):\n     \n         def setUp(self):\n             super(TestCase, self).setUp()\n\n... baby steps","commit_id":"35c82a041beb4d19a8da2103d7b1302b920268ed"},{"author":{"_account_id":7191,"name":"Jamie Lennox","email":"jamielennox@gmail.com","username":"jamielennox"},"change_message_id":"025b96eb607d37cc74fd0d4238692fd503fd0457","unresolved":false,"context_lines":[{"line_number":200,"context_line":"    return connect"},{"line_number":201,"context_line":""},{"line_number":202,"context_line":""},{"line_number":203,"context_line":"class TestCase(base.BaseTestCase):"},{"line_number":204,"context_line":""},{"line_number":205,"context_line":"    def setUp(self):"},{"line_number":206,"context_line":"        super(TestCase, self).setUp()"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa6399be_7f4f4e92","line":203,"in_reply_to":"fa6399be_aefe1a69","updated":"2016-10-12 00:28:44.000000000","message":"Yep, i don\u0027t use any other parts of the oslotest library at this point - though there is some tempfile handling in there you might find useful in future.","commit_id":"35c82a041beb4d19a8da2103d7b1302b920268ed"}]}
