diff -Nru betamax-0.8.0/betamax/cassette/interaction.py betamax-0.8.1/betamax/cassette/interaction.py --- betamax-0.8.0/betamax/cassette/interaction.py 2016-04-29 15:06:30.000000000 +0000 +++ betamax-0.8.1/betamax/cassette/interaction.py 2018-03-13 21:49:44.000000000 +0000 @@ -72,8 +72,11 @@ for obj in ('request', 'response'): headers = self.data[obj]['headers'] for k, v in list(headers.items()): - v = util.from_list(v) - headers[k] = v.replace(text_to_replace, placeholder) + if isinstance(v, list): + headers[k] = [hv.replace(text_to_replace, placeholder) + for hv in v] + else: + headers[k] = v.replace(text_to_replace, placeholder) def replace_in_body(self, text_to_replace, placeholder): for obj in ('request', 'response'): diff -Nru betamax-0.8.0/betamax/exceptions.py betamax-0.8.1/betamax/exceptions.py --- betamax-0.8.0/betamax/exceptions.py 2016-08-12 11:25:58.000000000 +0000 +++ betamax-0.8.1/betamax/exceptions.py 2018-03-13 21:50:46.000000000 +0000 @@ -2,9 +2,6 @@ def __init__(self, message): super(BetamaxError, self).__init__(message) - def __repr__(self): - return 'BetamaxError("%s")' % self.message - class MissingDirectoryError(BetamaxError): pass diff -Nru betamax-0.8.0/betamax/fixtures/pytest.py betamax-0.8.1/betamax/fixtures/pytest.py --- betamax-0.8.0/betamax/fixtures/pytest.py 2016-08-16 21:51:53.000000000 +0000 +++ betamax-0.8.1/betamax/fixtures/pytest.py 2018-03-13 21:49:44.000000000 +0000 @@ -17,8 +17,10 @@ def _sanitize(name): - """Replace whitespace and / with -""" - return re.sub('[\s/]+', '-', name) + """ + Replace certain characters (which might be problematic when contained in + strings which will be used as file names) by '-'s. """ + return re.sub(r'[\s/<>:\\"|?*]', '-', name) def _casette_name(request, parametrized): diff -Nru betamax-0.8.0/betamax/fixtures/unittest.py betamax-0.8.1/betamax/fixtures/unittest.py --- betamax-0.8.0/betamax/fixtures/unittest.py 2015-07-16 01:00:31.000000000 +0000 +++ betamax-0.8.1/betamax/fixtures/unittest.py 2017-01-19 14:23:00.000000000 +0000 @@ -48,7 +48,10 @@ # NOTE(sigmavirus24): absolute_import is required to make import unittest work from __future__ import absolute_import -import unittest +try: + import unittest2 as unittest +except ImportError: + import unittest import requests diff -Nru betamax-0.8.0/betamax/__init__.py betamax-0.8.1/betamax/__init__.py --- betamax-0.8.0/betamax/__init__.py 2016-08-16 21:57:58.000000000 +0000 +++ betamax-0.8.1/betamax/__init__.py 2018-03-13 22:23:34.000000000 +0000 @@ -5,7 +5,7 @@ See https://betamax.readthedocs.io/ for documentation. -:copyright: (c) 2013-2016 by Ian Cordasco +:copyright: (c) 2013-2018 by Ian Stapleton Cordasco :license: Apache 2.0, see LICENSE for more details """ @@ -18,9 +18,9 @@ __all__ = ('BetamaxError', 'Betamax', 'BaseMatcher', 'BaseSerializer', 'use_cassette') -__author__ = 'Ian Cordasco' -__copyright__ = 'Copyright 2013-2014 Ian Cordasco' +__author__ = 'Ian Stapleton Cordasco' +__copyright__ = 'Copyright 2013-2018 Ian Stapleton Cordasco' __license__ = 'Apache 2.0' __title__ = 'betamax' -__version__ = '0.8.0' +__version__ = '0.8.1' __version_info__ = tuple(int(i) for i in __version__.split('.')) diff -Nru betamax-0.8.0/betamax/serializers/base.py betamax-0.8.1/betamax/serializers/base.py --- betamax-0.8.0/betamax/serializers/base.py 2015-04-12 20:43:22.000000000 +0000 +++ betamax-0.8.1/betamax/serializers/base.py 2018-03-13 21:49:44.000000000 +0000 @@ -26,7 +26,7 @@ def serialize(self, cassette_data): # Take a dictionary and convert it to whatever - def deserialize(self): + def deserialize(self, cassette_data): # Uses a cassette file to return a dictionary with the # cassette information diff -Nru betamax-0.8.0/betamax.egg-info/PKG-INFO betamax-0.8.1/betamax.egg-info/PKG-INFO --- betamax-0.8.0/betamax.egg-info/PKG-INFO 2016-08-16 22:00:40.000000000 +0000 +++ betamax-0.8.1/betamax.egg-info/PKG-INFO 2018-03-13 22:24:57.000000000 +0000 @@ -1,11 +1,12 @@ Metadata-Version: 1.1 Name: betamax -Version: 0.8.0 +Version: 0.8.1 Summary: A VCR imitation for python-requests Home-page: https://github.com/sigmavirus24/betamax -Author: Ian Cordasco +Author: Ian Stapleton Cordasco Author-email: graffatcolmingov@gmail.com License: Apache 2.0 +Description-Content-Type: UNKNOWN Description: betamax ======= @@ -98,6 +99,16 @@ History ======= + 0.8.1 - 2018-03-13 + ------------------ + + - Previous attempts to sanitize cassette names were incomplete. + Sanitization has become more thorough which could have some affects on + existing cassette files. **This may cause new cassettes to be generated.** + + - Fix bug where there may be an exception raised in a + ``betamax.exceptions.BetamaxError`` repr. + 0.8.0 - 2016-08-16 ------------------ diff -Nru betamax-0.8.0/betamax.egg-info/requires.txt betamax-0.8.1/betamax.egg-info/requires.txt --- betamax-0.8.0/betamax.egg-info/requires.txt 2016-08-16 22:00:40.000000000 +0000 +++ betamax-0.8.1/betamax.egg-info/requires.txt 2018-03-13 22:24:57.000000000 +0000 @@ -1 +1 @@ -requests >= 2.0 +requests>=2.0 diff -Nru betamax-0.8.0/betamax.egg-info/SOURCES.txt betamax-0.8.1/betamax.egg-info/SOURCES.txt --- betamax-0.8.0/betamax.egg-info/SOURCES.txt 2016-08-16 22:00:42.000000000 +0000 +++ betamax-0.8.1/betamax.egg-info/SOURCES.txt 2018-03-13 22:24:57.000000000 +0000 @@ -58,7 +58,6 @@ docs/usage_patterns.rst tests/__init__.py tests/conftest.py -tests/cassettes/FakeBetamaxTestCase.test_fake.json tests/cassettes/GitHub_create_issue.json tests/cassettes/GitHub_emojis.json tests/cassettes/global_preserve_exact_body_bytes.json @@ -71,7 +70,10 @@ tests/cassettes/test.json tests/cassettes/test_replays_response_on_right_order.json tests/cassettes/tests.integration.test_fixtures.TestPyTestFixtures.test_pytest_fixture.json -tests/cassettes/tests.integration.test_fixtures.TestPyTestParametrizedFixtures.test_pytest_fixture[https:-httpbin.org-get].json +tests/cassettes/tests.integration.test_fixtures.TestPyTestParametrizedFixtures.test_pytest_fixture[https---httpbin.org-get].json +tests/cassettes/tests.integration.test_fixtures.test_pytest_parametrize_with_filesystem_problematic_chars[aaa-bbb].json +tests/cassettes/tests.integration.test_fixtures.test_pytest_parametrize_with_filesystem_problematic_chars[ccc-ddd].json +tests/cassettes/tests.integration.test_fixtures.test_pytest_parametrize_with_filesystem_problematic_chars[eee-fff].json tests/integration/__init__.py tests/integration/helper.py tests/integration/test_allow_playback_repeats.py diff -Nru betamax-0.8.0/debian/changelog betamax-0.8.1/debian/changelog --- betamax-0.8.0/debian/changelog 2016-09-18 16:04:15.000000000 +0000 +++ betamax-0.8.1/debian/changelog 2019-01-06 03:29:35.000000000 +0000 @@ -1,3 +1,35 @@ +betamax (0.8.1-1) unstable; urgency=medium + + [ Ondřej Nový ] + * d/control: Set Vcs-* to salsa.debian.org + * d/copyright: Use https protocol in Format field + * d/control: Remove ancient X-Python-Version field + * d/control: Remove ancient X-Python3-Version field + * Convert git repository from git-dpm to gbp layout + + [ Daniele Tricoli ] + * New upstream release. + * Refresh patches after git-dpm to gbp pq conversion. + * Add debian/gbp.conf. + * Bump compat level to 12. + * Add autopkgtests. + * debian/clean + - Add .pytest_cache directory. + * debian/control + - Update to use my debian.org mail address. + - Use only python3-sphinx in Build-Depends. + - Bump Standards-Version to 4.3.0 (no changes needed). + * debian/copyright + - Update to use my debian.org mail address. + - Update copyright years. + * debian/rules + - Use 'python3 -m sphinx' instead of sphinx-build for building docs. + - No need to set SPHINXOPTS since sphinx >=1.4 supports SOURCE_DATE_EPOCH. + - Remove test_cassette.test since generated by unittests. + - Enable a test previously disabled due urllib3 unbundling in Debian. + + -- Daniele Tricoli Sun, 06 Jan 2019 04:29:35 +0100 + betamax (0.8.0-1) unstable; urgency=medium * New upstream release. @@ -66,4 +98,3 @@ * Initial release. (Closes: #808880) -- Daniele Tricoli Sun, 03 Jan 2016 15:34:07 +0000 - diff -Nru betamax-0.8.0/debian/clean betamax-0.8.1/debian/clean --- betamax-0.8.0/debian/clean 2016-05-31 19:33:40.000000000 +0000 +++ betamax-0.8.1/debian/clean 2019-01-06 03:29:35.000000000 +0000 @@ -1,2 +1,3 @@ betamax.egg-info/* docs/build/ +.pytest_cache/ diff -Nru betamax-0.8.0/debian/compat betamax-0.8.1/debian/compat --- betamax-0.8.0/debian/compat 2016-05-31 19:33:40.000000000 +0000 +++ betamax-0.8.1/debian/compat 2019-01-06 03:29:35.000000000 +0000 @@ -1 +1 @@ -9 +12 diff -Nru betamax-0.8.0/debian/control betamax-0.8.1/debian/control --- betamax-0.8.0/debian/control 2016-09-18 16:04:15.000000000 +0000 +++ betamax-0.8.1/debian/control 2019-01-06 03:29:35.000000000 +0000 @@ -2,29 +2,27 @@ Section: python Priority: optional Maintainer: Debian Python Modules Team -Uploaders: Daniele Tricoli , +Uploaders: Daniele Tricoli , Ian Cordasco Build-Depends: - debhelper (>= 9), + debhelper (>= 12), dh-python (>= 2.20160609), python-all, python-mock, python-pytest, python-requests (>= 2.0), python-setuptools, - python-sphinx (>= 1.3), python3-all, python3-doc, python3-mock, python3-pytest, python3-requests (>= 2.0), python3-setuptools, -Standards-Version: 3.9.8 -X-Python-Version: >= 2.7 -X-Python3-Version: >= 3.3 + python3-sphinx (>= 1.4), +Standards-Version: 4.3.0 Homepage: https://github.com/sigmavirus24/betamax -Vcs-Git: https://anonscm.debian.org/git/python-modules/packages/betamax.git -Vcs-Browser: https://anonscm.debian.org/cgit/python-modules/packages/betamax.git +Vcs-Git: https://salsa.debian.org/python-team/modules/betamax.git +Vcs-Browser: https://salsa.debian.org/python-team/modules/betamax Package: python-betamax Architecture: all diff -Nru betamax-0.8.0/debian/copyright betamax-0.8.1/debian/copyright --- betamax-0.8.0/debian/copyright 2016-06-05 20:50:42.000000000 +0000 +++ betamax-0.8.1/debian/copyright 2019-01-06 03:29:35.000000000 +0000 @@ -1,4 +1,4 @@ -Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: betamax Upstream-Contact: Ian Cordasco Source: https://github.com/sigmavirus24/betamax @@ -12,7 +12,7 @@ License: Expat Files: debian/* -Copyright: 2016, Daniele Tricoli , +Copyright: 2016-2019, Daniele Tricoli , 2016, Ian Cordasco License: Apache diff -Nru betamax-0.8.0/debian/gbp.conf betamax-0.8.1/debian/gbp.conf --- betamax-0.8.0/debian/gbp.conf 1970-01-01 00:00:00.000000000 +0000 +++ betamax-0.8.1/debian/gbp.conf 2019-01-06 03:29:35.000000000 +0000 @@ -0,0 +1,2 @@ +[DEFAULT] +debian-branch=debian/master diff -Nru betamax-0.8.0/debian/.git-dpm betamax-0.8.1/debian/.git-dpm --- betamax-0.8.0/debian/.git-dpm 2016-09-18 16:04:15.000000000 +0000 +++ betamax-0.8.1/debian/.git-dpm 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -# see git-dpm(1) from git-dpm package -b643a8e33f08864318ffab64c96fd12922b20cef -b643a8e33f08864318ffab64c96fd12922b20cef -9414c3ae38c7c86e7342496e0a8bf5f1aae37a01 -9414c3ae38c7c86e7342496e0a8bf5f1aae37a01 -betamax_0.8.0.orig.tar.gz -f01bfe5d550fa1e222b234502deb1f87c695b989 -78398 -debianTag="debian/%e%v" -patchedTag="patched/%e%v" -upstreamTag="upstream/%e%u" diff -Nru betamax-0.8.0/debian/patches/local-intersphinx.patch betamax-0.8.1/debian/patches/local-intersphinx.patch --- betamax-0.8.0/debian/patches/local-intersphinx.patch 2016-09-18 16:04:15.000000000 +0000 +++ betamax-0.8.1/debian/patches/local-intersphinx.patch 2019-01-06 03:29:35.000000000 +0000 @@ -1,4 +1,3 @@ -From b643a8e33f08864318ffab64c96fd12922b20cef Mon Sep 17 00:00:00 2001 From: Daniele Tricoli Date: Wed, 13 Jul 2016 17:51:57 +0200 Subject: Use local python3-doc for intersphinx diff -Nru betamax-0.8.0/debian/rules betamax-0.8.1/debian/rules --- betamax-0.8.0/debian/rules 2016-09-18 16:04:15.000000000 +0000 +++ betamax-0.8.1/debian/rules 2019-01-06 03:29:35.000000000 +0000 @@ -2,29 +2,26 @@ export PYBUILD_NAME=betamax -# test_fixtures.py needs package already installed, test_add_urllib3_response -# is broken due unbundling in Debian -# (see https://github.com/kennethreitz/requests/issues/2870) and remaining -# tests need Internet connection. +# test_fixtures.py needs package already installed and remaining tests need +# Internet connection. export PYBUILD_TEST_ARGS = --ignore tests/integration/test_fixtures.py \ --ignore tests/integration/test_hooks.py \ --ignore tests/integration/test_placeholders.py \ --ignore tests/integration/test_record_modes.py \ --ignore tests/integration/test_unicode.py \ --ignore tests/regression/test_gzip_compression.py \ - --ignore tests/regression/test_requests_2_11_body_matcher.py \ - -k 'not test_add_urllib3_response' - -LAST_CHANGE = $(shell dpkg-parsechangelog -S Date) -BUILD_DATE = $(shell LC_ALL=C date -u "+%B %d, %Y" -d "$(LAST_CHANGE)") -SPHINXOPTS := -D html_last_updated_fmt="$(BUILD_DATE)" + --ignore tests/regression/test_requests_2_11_body_matcher.py %: dh $@ --with python2,python3,sphinxdoc --buildsystem=pybuild +override_dh_auto_install: + find .pybuild -type f -name test_cassette.test -delete + dh_auto_install + override_dh_sphinxdoc: ifeq (,$(findstring nodocs, $(DEB_BUILD_OPTIONS))) - PYTHONPATH=. sphinx-build $(SPHINXOPTS) -N -bhtml docs/ \ + PYTHONPATH=. python3 -m sphinx -b html docs/ \ debian/python-betamax-doc/usr/share/doc/python-betamax-doc/html/ dh_sphinxdoc endif diff -Nru betamax-0.8.0/debian/tests/control betamax-0.8.1/debian/tests/control --- betamax-0.8.0/debian/tests/control 1970-01-01 00:00:00.000000000 +0000 +++ betamax-0.8.1/debian/tests/control 2019-01-06 03:29:35.000000000 +0000 @@ -0,0 +1,13 @@ +Tests: unittests +Depends: + python-all, + python-betamax, + python-mock, + python-pytest, + +Tests: unittests3 +Depends: + python3-all, + python3-betamax, + python3-mock, + python3-pytest, diff -Nru betamax-0.8.0/debian/tests/unittests betamax-0.8.1/debian/tests/unittests --- betamax-0.8.0/debian/tests/unittests 1970-01-01 00:00:00.000000000 +0000 +++ betamax-0.8.1/debian/tests/unittests 2019-01-06 03:29:35.000000000 +0000 @@ -0,0 +1,17 @@ +#!/bin/sh -e + +TESTS_TO_EXCLUDE="tests/integration/test_hooks.py \ +tests/integration/test_placeholders.py \ +tests/integration/test_record_modes.py \ +tests/integration/test_unicode.py \ +tests/regression/test_gzip_compression.py \ +tests/regression/test_requests_2_11_body_matcher.py" + +cp -r tests "$AUTOPKGTEST_TMP" +cd "$AUTOPKGTEST_TMP" + +for test in ${TESTS_TO_EXCLUDE}; do + rm ${test} +done + +pyversions -i | tr ' ' '\n' | xargs -I {} env {} -Wd -m pytest -v -x -rs 2>&1 diff -Nru betamax-0.8.0/debian/tests/unittests3 betamax-0.8.1/debian/tests/unittests3 --- betamax-0.8.0/debian/tests/unittests3 1970-01-01 00:00:00.000000000 +0000 +++ betamax-0.8.1/debian/tests/unittests3 2019-01-06 03:29:35.000000000 +0000 @@ -0,0 +1,17 @@ +#!/bin/sh -e + +TESTS_TO_EXCLUDE="tests/integration/test_hooks.py \ +tests/integration/test_placeholders.py \ +tests/integration/test_record_modes.py \ +tests/integration/test_unicode.py \ +tests/regression/test_gzip_compression.py \ +tests/regression/test_requests_2_11_body_matcher.py" + +cp -r tests "$AUTOPKGTEST_TMP" +cd "$AUTOPKGTEST_TMP" + +for test in ${TESTS_TO_EXCLUDE}; do + rm ${test} +done + +py3versions -i | tr ' ' '\n' | xargs -I {} env {} -Wd -m pytest -v -x -rs 2>&1 diff -Nru betamax-0.8.0/docs/configuring.rst betamax-0.8.1/docs/configuring.rst --- betamax-0.8.0/docs/configuring.rst 2016-04-29 16:01:58.000000000 +0000 +++ betamax-0.8.1/docs/configuring.rst 2017-01-19 14:23:00.000000000 +0000 @@ -72,7 +72,7 @@ Setting Default Cassette Options ```````````````````````````````` -Cassettes have default options used by Betmax if none are set. For example, +Cassettes have default options used by Betamax if none are set. For example, - The default record mode is ``once``. @@ -115,7 +115,7 @@ import os - import betmax + import betamax import requests from my_module import me diff -Nru betamax-0.8.0/docs/integrations.rst betamax-0.8.1/docs/integrations.rst --- betamax-0.8.0/docs/integrations.rst 2016-02-06 16:30:09.000000000 +0000 +++ betamax-0.8.1/docs/integrations.rst 2017-01-19 14:23:00.000000000 +0000 @@ -85,8 +85,8 @@ from betamax.fixtures import unittest - class IntegrationTestCase(unitest.BetamaxTestCase): - # Add your the rest of the helper methods you want for your + class IntegrationTestCase(unittest.BetamaxTestCase): + # Add the rest of the helper methods you want for your # integration tests @@ -122,8 +122,8 @@ from myapi import session - class IntegrationTestCase(unitest.BetamaxTestCase): - # Add your the rest of the helper methods you want for your + class IntegrationTestCase(unittest.BetamaxTestCase): + # Add the rest of the helper methods you want for your # integration tests SESSION_CLASS = session.MyApiSession diff -Nru betamax-0.8.0/docs/introduction.rst betamax-0.8.1/docs/introduction.rst --- betamax-0.8.0/docs/introduction.rst 2016-01-17 18:55:15.000000000 +0000 +++ betamax-0.8.1/docs/introduction.rst 2017-01-19 14:23:00.000000000 +0000 @@ -100,7 +100,7 @@ If we now run our new example, we'll see a new file appear in our :file:`examples/cassettes/` directory named -:file:`more-complciated-cassettes.json`. This cassette will be much larger as +:file:`more-complicated-cassettes.json`. This cassette will be much larger as a result of making 3 requests and receiving 3 responses. You'll also notice that we imported :mod:`betamax_serializers.pretty_json` and called :meth:`~betamax.Betamax.register_serializer` with diff -Nru betamax-0.8.0/docs/usage_patterns.rst betamax-0.8.1/docs/usage_patterns.rst --- betamax-0.8.0/docs/usage_patterns.rst 2016-01-17 23:59:40.000000000 +0000 +++ betamax-0.8.1/docs/usage_patterns.rst 2017-01-19 14:23:00.000000000 +0000 @@ -53,8 +53,8 @@ ensure we're authenticated when possible but that we do not leave our placeholder in the cassettes when they're replayed. -Using Human Readble JSON Cassettes ----------------------------------- +Using Human Readable JSON Cassettes +----------------------------------- Using the ``PrettyJSONSerializer`` provided by the ``betamax_serializers`` package provides human readable JSON cassettes. Cassettes output in this way diff -Nru betamax-0.8.0/HISTORY.rst betamax-0.8.1/HISTORY.rst --- betamax-0.8.0/HISTORY.rst 2016-08-16 21:59:48.000000000 +0000 +++ betamax-0.8.1/HISTORY.rst 2018-03-13 22:23:21.000000000 +0000 @@ -1,6 +1,16 @@ History ======= +0.8.1 - 2018-03-13 +------------------ + +- Previous attempts to sanitize cassette names were incomplete. + Sanitization has become more thorough which could have some affects on + existing cassette files. **This may cause new cassettes to be generated.** + +- Fix bug where there may be an exception raised in a + ``betamax.exceptions.BetamaxError`` repr. + 0.8.0 - 2016-08-16 ------------------ diff -Nru betamax-0.8.0/PKG-INFO betamax-0.8.1/PKG-INFO --- betamax-0.8.0/PKG-INFO 2016-08-16 22:00:42.000000000 +0000 +++ betamax-0.8.1/PKG-INFO 2018-03-13 22:24:57.000000000 +0000 @@ -1,11 +1,12 @@ Metadata-Version: 1.1 Name: betamax -Version: 0.8.0 +Version: 0.8.1 Summary: A VCR imitation for python-requests Home-page: https://github.com/sigmavirus24/betamax -Author: Ian Cordasco +Author: Ian Stapleton Cordasco Author-email: graffatcolmingov@gmail.com License: Apache 2.0 +Description-Content-Type: UNKNOWN Description: betamax ======= @@ -98,6 +99,16 @@ History ======= + 0.8.1 - 2018-03-13 + ------------------ + + - Previous attempts to sanitize cassette names were incomplete. + Sanitization has become more thorough which could have some affects on + existing cassette files. **This may cause new cassettes to be generated.** + + - Fix bug where there may be an exception raised in a + ``betamax.exceptions.BetamaxError`` repr. + 0.8.0 - 2016-08-16 ------------------ diff -Nru betamax-0.8.0/setup.cfg betamax-0.8.1/setup.cfg --- betamax-0.8.0/setup.cfg 2016-08-16 22:00:42.000000000 +0000 +++ betamax-0.8.1/setup.cfg 2018-03-13 22:24:57.000000000 +0000 @@ -4,5 +4,4 @@ [egg_info] tag_build = tag_date = 0 -tag_svn_revision = 0 diff -Nru betamax-0.8.0/setup.py betamax-0.8.1/setup.py --- betamax-0.8.0/setup.py 2016-02-06 16:30:02.000000000 +0000 +++ betamax-0.8.1/setup.py 2018-03-13 22:21:51.000000000 +0000 @@ -35,7 +35,7 @@ long_description="\n\n".join([data_for("README.rst"), data_for("HISTORY.rst")]), license="Apache 2.0", - author="Ian Cordasco", + author="Ian Stapleton Cordasco", author_email="graffatcolmingov@gmail.com", url="https://github.com/sigmavirus24/betamax", packages=packages, diff -Nru betamax-0.8.0/tests/cassettes/FakeBetamaxTestCase.test_fake.json betamax-0.8.1/tests/cassettes/FakeBetamaxTestCase.test_fake.json --- betamax-0.8.0/tests/cassettes/FakeBetamaxTestCase.test_fake.json 2016-08-10 10:45:01.000000000 +0000 +++ betamax-0.8.1/tests/cassettes/FakeBetamaxTestCase.test_fake.json 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -{"http_interactions": [], "recorded_with": "betamax/0.7.2"} \ No newline at end of file diff -Nru betamax-0.8.0/tests/cassettes/tests.integration.test_fixtures.TestPyTestParametrizedFixtures.test_pytest_fixture[https---httpbin.org-get].json betamax-0.8.1/tests/cassettes/tests.integration.test_fixtures.TestPyTestParametrizedFixtures.test_pytest_fixture[https---httpbin.org-get].json --- betamax-0.8.0/tests/cassettes/tests.integration.test_fixtures.TestPyTestParametrizedFixtures.test_pytest_fixture[https---httpbin.org-get].json 1970-01-01 00:00:00.000000000 +0000 +++ betamax-0.8.1/tests/cassettes/tests.integration.test_fixtures.TestPyTestParametrizedFixtures.test_pytest_fixture[https---httpbin.org-get].json 2018-03-13 21:49:44.000000000 +0000 @@ -0,0 +1 @@ +{"http_interactions": [{"request": {"body": {"string": "", "encoding": "utf-8"}, "headers": {"Connection": ["keep-alive"], "Accept-Encoding": ["gzip, deflate"], "Accept": ["*/*"], "User-Agent": ["python-requests/2.13.0"]}, "method": "GET", "uri": "https://httpbin.org/get"}, "response": {"body": {"string": "{\n \"args\": {}, \n \"headers\": {\n \"Accept\": \"*/*\", \n \"Accept-Encoding\": \"gzip, deflate\", \n \"Host\": \"httpbin.org\", \n \"User-Agent\": \"python-requests/2.13.0\"\n }, \n \"origin\": \"216.98.56.20\", \n \"url\": \"https://httpbin.org/get\"\n}\n", "encoding": null}, "headers": {"Content-Length": ["238"], "Server": ["nginx"], "Connection": ["keep-alive"], "Access-Control-Allow-Credentials": ["true"], "Date": ["Fri, 10 Mar 2017 16:58:21 GMT"], "Access-Control-Allow-Origin": ["*"], "Content-Type": ["application/json"]}, "status": {"message": "OK", "code": 200}, "url": "https://httpbin.org/get"}, "recorded_at": "2017-03-10T16:58:21"}], "recorded_with": "betamax/0.8.0"} \ No newline at end of file diff -Nru betamax-0.8.0/tests/cassettes/tests.integration.test_fixtures.TestPyTestParametrizedFixtures.test_pytest_fixture[https:-httpbin.org-get].json betamax-0.8.1/tests/cassettes/tests.integration.test_fixtures.TestPyTestParametrizedFixtures.test_pytest_fixture[https:-httpbin.org-get].json --- betamax-0.8.0/tests/cassettes/tests.integration.test_fixtures.TestPyTestParametrizedFixtures.test_pytest_fixture[https:-httpbin.org-get].json 2016-08-16 21:51:53.000000000 +0000 +++ betamax-0.8.1/tests/cassettes/tests.integration.test_fixtures.TestPyTestParametrizedFixtures.test_pytest_fixture[https:-httpbin.org-get].json 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -{"recorded_with": "betamax/0.4.2", "http_interactions": [{"recorded_at": "2015-05-25T00:46:42", "response": {"body": {"encoding": null, "string": "{\n \"args\": {}, \n \"headers\": {\n \"Accept\": \"*/*\", \n \"Accept-Encoding\": \"gzip, deflate\", \n \"Host\": \"httpbin.org\", \n \"User-Agent\": \"python-requests/2.6.0 CPython/3.4.2 Darwin/14.1.0\"\n }, \n \"origin\": \"72.160.201.47\", \n \"url\": \"https://httpbin.org/get\"\n}\n"}, "status": {"message": "OK", "code": 200}, "url": "https://httpbin.org/get", "headers": {"connection": ["keep-alive"], "content-type": ["application/json"], "content-length": ["266"], "date": ["Mon, 25 May 2015 00:46:42 GMT"], "access-control-allow-origin": ["*"], "access-control-allow-credentials": ["true"], "server": ["nginx"]}}, "request": {"method": "GET", "body": {"encoding": "utf-8", "string": ""}, "uri": "https://httpbin.org/get", "headers": {"Connection": ["keep-alive"], "User-Agent": ["python-requests/2.6.0 CPython/3.4.2 Darwin/14.1.0"], "Accept": ["*/*"], "Accept-Encoding": ["gzip, deflate"]}}}]} \ No newline at end of file diff -Nru betamax-0.8.0/tests/cassettes/tests.integration.test_fixtures.test_pytest_parametrize_with_filesystem_problematic_chars[aaa-bbb].json betamax-0.8.1/tests/cassettes/tests.integration.test_fixtures.test_pytest_parametrize_with_filesystem_problematic_chars[aaa-bbb].json --- betamax-0.8.0/tests/cassettes/tests.integration.test_fixtures.test_pytest_parametrize_with_filesystem_problematic_chars[aaa-bbb].json 1970-01-01 00:00:00.000000000 +0000 +++ betamax-0.8.1/tests/cassettes/tests.integration.test_fixtures.test_pytest_parametrize_with_filesystem_problematic_chars[aaa-bbb].json 2018-03-13 21:49:44.000000000 +0000 @@ -0,0 +1 @@ +{"http_interactions": [], "recorded_with": "betamax/0.8.0"} \ No newline at end of file diff -Nru betamax-0.8.0/tests/cassettes/tests.integration.test_fixtures.test_pytest_parametrize_with_filesystem_problematic_chars[ccc-ddd].json betamax-0.8.1/tests/cassettes/tests.integration.test_fixtures.test_pytest_parametrize_with_filesystem_problematic_chars[ccc-ddd].json --- betamax-0.8.0/tests/cassettes/tests.integration.test_fixtures.test_pytest_parametrize_with_filesystem_problematic_chars[ccc-ddd].json 1970-01-01 00:00:00.000000000 +0000 +++ betamax-0.8.1/tests/cassettes/tests.integration.test_fixtures.test_pytest_parametrize_with_filesystem_problematic_chars[ccc-ddd].json 2018-03-13 21:49:44.000000000 +0000 @@ -0,0 +1 @@ +{"http_interactions": [], "recorded_with": "betamax/0.8.0"} \ No newline at end of file diff -Nru betamax-0.8.0/tests/cassettes/tests.integration.test_fixtures.test_pytest_parametrize_with_filesystem_problematic_chars[eee-fff].json betamax-0.8.1/tests/cassettes/tests.integration.test_fixtures.test_pytest_parametrize_with_filesystem_problematic_chars[eee-fff].json --- betamax-0.8.0/tests/cassettes/tests.integration.test_fixtures.test_pytest_parametrize_with_filesystem_problematic_chars[eee-fff].json 1970-01-01 00:00:00.000000000 +0000 +++ betamax-0.8.1/tests/cassettes/tests.integration.test_fixtures.test_pytest_parametrize_with_filesystem_problematic_chars[eee-fff].json 2018-03-13 21:49:44.000000000 +0000 @@ -0,0 +1 @@ +{"http_interactions": [], "recorded_with": "betamax/0.8.0"} \ No newline at end of file diff -Nru betamax-0.8.0/tests/integration/test_fixtures.py betamax-0.8.1/tests/integration/test_fixtures.py --- betamax-0.8.0/tests/integration/test_fixtures.py 2016-08-16 21:51:53.000000000 +0000 +++ betamax-0.8.1/tests/integration/test_fixtures.py 2018-03-13 21:49:44.000000000 +0000 @@ -36,7 +36,7 @@ cassette_name = ('tests.integration.test_fixtures.' # Module name 'TestPyTestParametrizedFixtures.' # Class name 'test_pytest_fixture' # Test function name - '[https:-httpbin.org-get]' # Parameter + '[https---httpbin.org-get]' # Parameter '.json') file_name = os.path.join(test_dir, 'tests', 'cassettes', cassette_name) @@ -49,3 +49,12 @@ """Exercise the fixture itself.""" resp = betamax_parametrized_session.get(url) assert resp.ok + + +@pytest.mark.parametrize('problematic_arg', [r'aaa\bbb', 'ccc:ddd', 'eee*fff']) +def test_pytest_parametrize_with_filesystem_problematic_chars( + betamax_parametrized_session, problematic_arg): + """ + Exercice parametrized args containing characters which might cause + problems when getting translated into file names. """ + assert True diff -Nru betamax-0.8.0/tests/integration/test_placeholders.py betamax-0.8.1/tests/integration/test_placeholders.py --- betamax-0.8.0/tests/integration/test_placeholders.py 2016-04-29 15:06:30.000000000 +0000 +++ betamax-0.8.1/tests/integration/test_placeholders.py 2018-03-13 21:49:44.000000000 +0000 @@ -38,4 +38,4 @@ self.cassette_path = cassette.cassette_path i = cassette.interactions[0] auth = i.data['request']['headers']['Authorization'] - assert '' in auth + assert '' in auth[0] diff -Nru betamax-0.8.0/tests/integration/test_record_modes.py betamax-0.8.1/tests/integration/test_record_modes.py --- betamax-0.8.0/tests/integration/test_record_modes.py 2016-04-26 14:20:58.000000000 +0000 +++ betamax-0.8.1/tests/integration/test_record_modes.py 2018-03-13 21:49:44.000000000 +0000 @@ -29,12 +29,16 @@ r0_headers = r0.headers.copy() r0_headers.pop('Date') r0_headers.pop('Age', None) + r0_headers.pop('X-Processed-Time', None) r1_headers = r1.headers.copy() r1_headers.pop('Date') r1_headers.pop('Age', None) + r1_headers.pop('X-Processed-Time', None) # NOTE(sigmavirus24): This fails if the second request is # technically a second later. Ignoring the Date headers allows # this test to succeed. + # NOTE(hroncok): httpbin.org added X-Processed-Time header that + # can possibly differ (and often does) assert r0_headers == r1_headers assert r0.content == r1.content diff -Nru betamax-0.8.0/tests/unit/test_cassette.py betamax-0.8.1/tests/unit/test_cassette.py --- betamax-0.8.0/tests/unit/test_cassette.py 2016-08-12 11:25:58.000000000 +0000 +++ betamax-0.8.1/tests/unit/test_cassette.py 2018-03-13 21:49:44.000000000 +0000 @@ -354,7 +354,8 @@ }, 'headers': { 'Content-Type': [decode('foo')], - 'Set-Cookie': ['cookie_name=cookie_value'] + 'Set-Cookie': ['cookie_name=cookie_value', + 'sessionid=deadbeef'] }, 'status_code': 200, 'url': 'http://example.com', @@ -386,13 +387,14 @@ for attr in ['status_code', 'url']: assert self.response[attr] == decode(getattr(r, attr)) - headers = dict((k, v[0]) for k, v in self.response['headers'].items()) + headers = dict((k, ', '.join(v)) + for k, v in self.response['headers'].items()) assert headers == r.headers tested_cookie = False for cookie in r.cookies: cookie_str = "{0}={1}".format(cookie.name, cookie.value) - assert cookie_str == r.headers['Set-Cookie'] + assert cookie_str in r.headers['Set-Cookie'] tested_cookie = True assert tested_cookie @@ -420,10 +422,12 @@ self.interaction.replace('foo', '') self.interaction.replace('http://example.com', '') - header = self.interaction.data['request']['headers']['Authorization'] + header = ( + self.interaction.data['request']['headers']['Authorization'][0]) assert header == '' header = self.interaction.data['response']['headers']['Set-Cookie'] - assert header == 'cookie_name=' + assert header[0] == 'cookie_name=' + assert header[1] == 'sessionid=deadbeef' body = self.interaction.data['request']['body']['string'] assert body == 'key=value&key2=' body = self.interaction.data['response']['body'] @@ -436,9 +440,10 @@ def test_replace_in_headers(self): self.interaction.replace_in_headers('123456789abcdef', '') self.interaction.replace_in_headers('cookie_value', '') - header = self.interaction.data['request']['headers']['Authorization'] + header = ( + self.interaction.data['request']['headers']['Authorization'][0]) assert header == '' - header = self.interaction.data['response']['headers']['Set-Cookie'] + header = self.interaction.data['response']['headers']['Set-Cookie'][0] assert header == 'cookie_name=' def test_replace_in_body(self): diff -Nru betamax-0.8.0/tests/unit/test_exceptions.py betamax-0.8.1/tests/unit/test_exceptions.py --- betamax-0.8.0/tests/unit/test_exceptions.py 2016-08-12 11:25:58.000000000 +0000 +++ betamax-0.8.1/tests/unit/test_exceptions.py 2018-03-13 22:15:05.000000000 +0000 @@ -33,3 +33,11 @@ def test_invalid_option_is_validation_error(self): assert isinstance(exceptions.InvalidOption('msg'), exceptions.ValidationError) + + def test_betamaxerror_repr(self): + """Ensure errors don't raise exceptions in their __repr__. + + This should protect against regression. If this test starts failing, + heavily modify it to not be flakey. + """ + assert "BetamaxError" in repr(exceptions.BetamaxError('test'))