--- /srv/rebuilderd/tmp/rebuilderdFGUUgA/inputs/python-betamax-doc_0.9.0-1_all.deb
+++ /srv/rebuilderd/tmp/rebuilderdFGUUgA/out/python-betamax-doc_0.9.0-1_all.deb
├── file list
│ @@ -1,3 +1,3 @@
│ -rw-r--r-- 0 0 0 4 2024-02-21 10:32:41.000000 debian-binary
│ -rw-r--r-- 0 0 0 1988 2024-02-21 10:32:41.000000 control.tar.xz
│ --rw-r--r-- 0 0 0 63276 2024-02-21 10:32:41.000000 data.tar.xz
│ +-rw-r--r-- 0 0 0 63140 2024-02-21 10:32:41.000000 data.tar.xz
├── control.tar.xz
│ ├── control.tar
│ │ ├── ./control
│ │ │ @@ -1,13 +1,13 @@
│ │ │ Package: python-betamax-doc
│ │ │ Source: betamax
│ │ │ Version: 0.9.0-1
│ │ │ Architecture: all
│ │ │ Maintainer: Debian Python Team Tell Betamax which cassette you wish to use for the context. cassette_name (str) – relative name, without the serialization
│ │ │ + cassette_name (str) – relative name, without the serialization
│ │ │ format, of the cassette you wish Betamax would use serialize_with (str) – the format you want Betamax to serialize
│ │ │ + serialize_with (str) – the format you want Betamax to serialize
│ │ │ the cassette with serialize (str) – DEPRECATED the format you want Betamax to
│ │ │ + serialize (str) – DEPRECATED the format you want Betamax to
│ │ │ serialize the request and response data to and from cassette_name (str) – Name of the cassette file in which interactions will be stored. cassette_library_dir (str) – Directory in which cassette files will be stored. default_cassette_options (dict) – Dictionary of default cassette options to set for the cassette used
│ │ │ + cassette_name (str) – Name of the cassette file in which interactions will be stored. cassette_library_dir (str) – Directory in which cassette files will be stored. default_cassette_options (dict) – Dictionary of default cassette options to set for the cassette used
│ │ │ when recording these interactions. **use_cassette_kwargs – Keyword arguments passed to tag (str) – Limits the interactions passed to the function based on the
│ │ │ + tag (str) – Limits the interactions passed to the function based on the
│ │ │ interaction’s tag (currently unsupported). callback (callable) – The function which either accepts just an interaction or an
│ │ │ interaction and a cassette and mutates the interaction before
│ │ │ returning. tag (str) – Limits the interactions passed to the function based on the
│ │ │ + tag (str) – Limits the interactions passed to the function based on the
│ │ │ interaction’s tag (currently unsupported). callback (callable) – The function which either accepts just an interaction or an
│ │ │ interaction and a cassette and mutates the interaction before
│ │ │ returning. Define a placeholder value for some text. This also will replace the placeholder text with the text you wish it
│ │ │ to use when replaying interactions from cassettes. placeholder (str) – (required), text to be used as a placeholder replace (str) – (required), text to be replaced or replacing the
│ │ │ + placeholder (str) – (required), text to be used as a placeholder replace (str) – (required), text to be replaced or replacing the
│ │ │ placeholder An instantiated requests Session wrapped by Betamax. Minimal Minimal Betamax integration for unittest. New in version 0.5.0. To change the default cassette format, override this method in a
│ │ │ subclass. Cassette name for the current test. str
│ │ │
│ │ │
│ │ │
│ │ │ @@ -177,17 +177,17 @@
│ │ │ def test_get(session):
│ │ │ # do things with session
│ │ │
│ │ │
│ │ │
│ │ │
│ │ │
│ │ │ -
│ │ │
│ │ │
│ │ │
│ │ │
│ │ │ @@ -237,15 +237,15 @@
│ │ │ with Betamax.configure() as config:
│ │ │ config.before_playback(callback=before_playback)
│ │ │
│ │ │
│ │ │
│ │ │ -
│ │ │ use_cassette()
│ │ │
│ │ │ @@ -262,15 +262,15 @@
│ │ │ with Betamax.configure() as config:
│ │ │ config.before_record(callback=before_record)
│ │ │
│ │ │
│ │ │
│ │ │ -
│ │ │
│ │ │
│ │ │ @@ -323,16 +323,16 @@
│ │ │ define_cassette_placeholder(placeholder, replace)¶
│ │ │
│ │ │ -
│ │ │
│ │ │
│ │ │
│ │ │ -
│ │ │ unittest.TestCase
subclass adding Betamax integration.unittest.TestCase
subclass adding Betamax integration.
│ │ │
│ │ │
│ │ │
│ │ │
│ │ │
│ │ │
When using Betamax with unittest, you can use the traditional style of Betamax
│ │ │ covered in the documentation thoroughly, or you can use your fixture methods,
│ │ │ -unittest.TestCase.setUp()
and unittest.TestCase.tearDown()
to wrap
│ │ │ +unittest.TestCase.setUp()
and unittest.TestCase.tearDown()
to wrap
│ │ │ entire tests in Betamax.
Here’s how you might use it:
│ │ │from betamax.fixtures import unittest
│ │ │
│ │ │ from myapi import SessionManager
│ │ │ ├── html2text {}
│ │ │ │ @@ -52,39 +52,39 @@
│ │ │ │ start()_¶
│ │ │ │ Start recording or replaying interactions.
│ │ │ │ stop()_¶
│ │ │ │ Stop recording or replaying interactions.
│ │ │ │ use_cassette(ccaasssseettttee__nnaammee, ****kkwwaarrggss)_¶
│ │ │ │ Tell Betamax which cassette you wish to use for the context.
│ │ │ │ Parameters:
│ │ │ │ - * ccaasssseettttee__nnaammee (_ss_tt_rr) – relative name, without the
│ │ │ │ + * ccaasssseettttee__nnaammee (ssttrr) – relative name, without the
│ │ │ │ serialization format, of the cassette you wish Betamax
│ │ │ │ would use
│ │ │ │ - * sseerriiaalliizzee__wwiitthh (_ss_tt_rr) – the format you want Betamax to
│ │ │ │ + * sseerriiaalliizzee__wwiitthh (ssttrr) – the format you want Betamax to
│ │ │ │ serialize the cassette with
│ │ │ │ - * sseerriiaalliizzee (_ss_tt_rr) – DEPRECATED the format you want
│ │ │ │ + * sseerriiaalliizzee (ssttrr) – DEPRECATED the format you want
│ │ │ │ Betamax to serialize the request and response data to
│ │ │ │ and from
│ │ │ │ betamax.decorator.use_cassette(ccaasssseettttee__nnaammee, ccaasssseettttee__lliibbrraarryy__ddiirr==NNoonnee,
│ │ │ │ ddeeffaauulltt__ccaasssseettttee__ooppttiioonnss=={{}}, ****uussee__ccaasssseettttee__kkwwaarrggss)_¶
│ │ │ │ Provide a Betamax-wrapped Session for convenience.
│ │ │ │ New in version 0.5.0.
│ │ │ │ This decorator can be used to get a plain Session that has been wrapped
│ │ │ │ in Betamax. For example,
│ │ │ │ from betamax.decorator import use_cassette
│ │ │ │
│ │ │ │ @use_cassette('example-decorator', cassette_library_dir='.')
│ │ │ │ def test_get(session):
│ │ │ │ # do things with session
│ │ │ │ Parameters:
│ │ │ │ - * ccaasssseettttee__nnaammee (_ss_tt_rr) – Name of the cassette file in which
│ │ │ │ + * ccaasssseettttee__nnaammee (ssttrr) – Name of the cassette file in which
│ │ │ │ interactions will be stored.
│ │ │ │ - * ccaasssseettttee__lliibbrraarryy__ddiirr (_ss_tt_rr) – Directory in which cassette
│ │ │ │ + * ccaasssseettttee__lliibbrraarryy__ddiirr (ssttrr) – Directory in which cassette
│ │ │ │ files will be stored.
│ │ │ │ - * ddeeffaauulltt__ccaasssseettttee__ooppttiioonnss (_dd_ii_cc_tt) – Dictionary of default
│ │ │ │ + * ddeeffaauulltt__ccaasssseettttee__ooppttiioonnss (ddiicctt) – Dictionary of default
│ │ │ │ cassette options to set for the cassette used when recording
│ │ │ │ these interactions.
│ │ │ │ * ****uussee__ccaasssseettttee__kkwwaarrggss – Keyword arguments passed to
│ │ │ │ _u_s_e___c_a_s_s_e_t_t_e_(_)
│ │ │ │ ccllaassss betamax.configure.Configuration_¶
│ │ │ │ This object acts as a proxy to configure different parts of Betamax.
│ │ │ │ You should only ever encounter this object when configuring the library
│ │ │ │ @@ -112,30 +112,30 @@
│ │ │ │ Example usage:
│ │ │ │ def before_playback(interaction, cassette):
│ │ │ │ pass
│ │ │ │
│ │ │ │ with Betamax.configure() as config:
│ │ │ │ config.before_playback(callback=before_playback)
│ │ │ │ Parameters:
│ │ │ │ - * ttaagg (_ss_tt_rr) – Limits the interactions passed to the
│ │ │ │ + * ttaagg (ssttrr) – Limits the interactions passed to the
│ │ │ │ function based on the interaction’s tag (currently
│ │ │ │ unsupported).
│ │ │ │ * ccaallllbbaacckk (ccaallllaabbllee) – The function which either accepts
│ │ │ │ just an interaction or an interaction and a cassette
│ │ │ │ and mutates the interaction before returning.
│ │ │ │ before_record(ttaagg==NNoonnee, ccaallllbbaacckk==NNoonnee)_¶
│ │ │ │ Register a function to call before recording an interaction.
│ │ │ │ Example usage:
│ │ │ │ def before_record(interaction, cassette):
│ │ │ │ pass
│ │ │ │
│ │ │ │ with Betamax.configure() as config:
│ │ │ │ config.before_record(callback=before_record)
│ │ │ │ Parameters:
│ │ │ │ - * ttaagg (_ss_tt_rr) – Limits the interactions passed to the
│ │ │ │ + * ttaagg (ssttrr) – Limits the interactions passed to the
│ │ │ │ function based on the interaction’s tag (currently
│ │ │ │ unsupported).
│ │ │ │ * ccaallllbbaacckk (ccaallllaabbllee) – The function which either accepts
│ │ │ │ just an interaction or an interaction and a cassette
│ │ │ │ and mutates the interaction before returning.
│ │ │ │ before_stop(ccaallllbbaacckk==NNoonnee)_¶
│ │ │ │ Register a function to call before Betamax stops.
│ │ │ │ @@ -161,28 +161,28 @@
│ │ │ │ * preserve_exact_body_bytes
│ │ │ │ Other options will be ignored.
│ │ │ │ define_cassette_placeholder(ppllaacceehhoollddeerr, rreeppllaaccee)_¶
│ │ │ │ Define a placeholder value for some text.
│ │ │ │ This also will replace the placeholder text with the text you wish
│ │ │ │ it to use when replaying interactions from cassettes.
│ │ │ │ Parameters:
│ │ │ │ - * ppllaacceehhoollddeerr (_ss_tt_rr) – (required), text to be used as a
│ │ │ │ + * ppllaacceehhoollddeerr (ssttrr) – (required), text to be used as a
│ │ │ │ placeholder
│ │ │ │ - * rreeppllaaccee (_ss_tt_rr) – (required), text to be replaced or
│ │ │ │ + * rreeppllaaccee (ssttrr) – (required), text to be replaced or
│ │ │ │ replacing the placeholder
│ │ │ │ A set of fixtures to integrate Betamax with py.test.
│ │ │ │ betamax.fixtures.pytest.betamax_session(bbeettaammaaxx__rreeccoorrddeerr)_¶
│ │ │ │ Generate a session that has Betamax already installed.
│ │ │ │ Seebetamax_recorderfixture.
│ │ │ │ Parameters:
│ │ │ │ bbeettaammaaxx__rreeccoorrddeerr – A recorder fixture with a configured request
│ │ │ │ session.
│ │ │ │ Returns:
│ │ │ │ An instantiated requests Session wrapped by Betamax.
│ │ │ │ -Minimal _u_n_i_t_t_e_s_t_._T_e_s_t_C_a_s_e subclass adding Betamax integration.
│ │ │ │ +Minimal unittest.TestCase subclass adding Betamax integration.
│ │ │ │ ccllaassss betamax.fixtures.unittest.BetamaxTestCase(mmeetthhooddNNaammee==''rruunnTTeesstt'')_¶
│ │ │ │ Betamax integration for unittest.
│ │ │ │ New in version 0.5.0.
│ │ │ │ CASSETTE_LIBRARY_DIR == NNoonnee_¶
│ │ │ │ Custom path to save cassette.
│ │ │ │ SESSION_CLASS_¶
│ │ │ │ Class that is a subclass of requests.Session
│ │ │ │ @@ -191,27 +191,27 @@
│ │ │ │ Generates a cassette name for the current test.
│ │ │ │ The default format is “%(classname)s.%(testMethodName)s”
│ │ │ │ To change the default cassette format, override this method in a
│ │ │ │ subclass.
│ │ │ │ Returns:
│ │ │ │ Cassette name for the current test.
│ │ │ │ Return type:
│ │ │ │ - _s_t_r
│ │ │ │ + str
│ │ │ │ setUp()_¶
│ │ │ │ Betamax-ified setUp fixture.
│ │ │ │ This will call the superclass’ setUp method ffiirrsstt and then it will
│ │ │ │ create a new requests.Session and wrap that in a Betamax object to
│ │ │ │ record it. At the end of setUp, it will start recording.
│ │ │ │ tearDown()_¶
│ │ │ │ Betamax-ified tearDown fixture.
│ │ │ │ This will call the superclass’ tearDown method ffiirrsstt and then it
│ │ │ │ will stop recording interactions.
│ │ │ │ When using Betamax with unittest, you can use the traditional style of Betamax
│ │ │ │ covered in the documentation thoroughly, or you can use your fixture methods,
│ │ │ │ -_u_n_i_t_t_e_s_t_._T_e_s_t_C_a_s_e_._s_e_t_U_p_(_) and _u_n_i_t_t_e_s_t_._T_e_s_t_C_a_s_e_._t_e_a_r_D_o_w_n_(_) to wrap entire tests
│ │ │ │ +unittest.TestCase.setUp() and unittest.TestCase.tearDown() to wrap entire tests
│ │ │ │ in Betamax.
│ │ │ │ Here’s how you might use it:
│ │ │ │ from betamax.fixtures import unittest
│ │ │ │
│ │ │ │ from myapi import SessionManager
│ │ ├── ./usr/share/doc/python-betamax-doc/html/integrations.html
│ │ │ @@ -98,15 +98,15 @@
│ │ │
│ │ │
│ │ │ Unittest Integration¶
│ │ │
│ │ │ New in version 0.5.0.
│ │ │
│ │ │ When writing tests with unittest, a common pattern is to either import
│ │ │ -unittest.TestCase
or subclass that and use that subclass in your
│ │ │ +unittest.TestCase
or subclass that and use that subclass in your
│ │ │ tests. When integrating Betamax with your unittest testsuite, you should do
│ │ │ the following:
│ │ │ from betamax.fixtures import unittest
│ │ │
│ │ │
│ │ │ class IntegrationTestCase(unittest.BetamaxTestCase):
│ │ │ # Add the rest of the helper methods you want for your
│ │ │ ├── html2text {}
│ │ │ │ @@ -49,15 +49,15 @@
│ │ │ │ betamax_recorder.current_cassette.match_options.add('json-body')
│ │ │ │ session = betamax_recorder.session
│ │ │ │
│ │ │ │ session.post('https://httpbin.org/post', json={'foo': 'bar'})
│ │ │ │ ********** UUnniitttteesstt IInntteeggrraattiioonn_?¶ **********
│ │ │ │ New in version 0.5.0.
│ │ │ │ When writing tests with unittest, a common pattern is to either import
│ │ │ │ -_u_n_i_t_t_e_s_t_._T_e_s_t_C_a_s_e or subclass that and use that subclass in your tests. When
│ │ │ │ +unittest.TestCase or subclass that and use that subclass in your tests. When
│ │ │ │ integrating Betamax with your unittest testsuite, you should do the following:
│ │ │ │ from betamax.fixtures import unittest
│ │ │ │
│ │ │ │
│ │ │ │ class IntegrationTestCase(unittest.BetamaxTestCase):
│ │ │ │ # Add the rest of the helper methods you want for your
│ │ │ │ # integration tests
│ │ ├── ./usr/share/doc/python-betamax-doc/html/matchers.html
│ │ │ @@ -131,15 +131,15 @@
│ │ │
│ │ │ match(request, recorded_request)¶
│ │ │ A method that must be implemented by the user.
│ │ │
│ │ │ - Parameters:
│ │ │
│ │ │ request (PreparedRequest) – A requests PreparedRequest object
│ │ │ -recorded_request (dict) – A dictionary containing the serialized
│ │ │ +
recorded_request (dict) – A dictionary containing the serialized
│ │ │ request in the cassette
│ │ │
│ │ │
│ │ │ - Returns bool:
│ │ │ True if they match else False
│ │ │
│ │ │
│ │ │ ├── html2text {}
│ │ │ │ @@ -57,15 +57,15 @@
│ │ │ │ * body
│ │ │ │ * headers
│ │ │ │ match(rreeqquueesstt, rreeccoorrddeedd__rreeqquueesstt)_¶
│ │ │ │ A method that must be implemented by the user.
│ │ │ │ Parameters:
│ │ │ │ * rreeqquueesstt (PPrreeppaarreeddRReeqquueesstt) – A requests PreparedRequest
│ │ │ │ object
│ │ │ │ - * rreeccoorrddeedd__rreeqquueesstt (_dd_ii_cc_tt) – A dictionary containing the
│ │ │ │ + * rreeccoorrddeedd__rreeqquueesstt (ddiicctt) – A dictionary containing the
│ │ │ │ serialized request in the cassette
│ │ │ │ Returns bool:
│ │ │ │ True if they match else False
│ │ │ │ on_init()_¶
│ │ │ │ Method to implement if you wish something to happen in __init__.
│ │ │ │ The return value is not checked and this is called at the end of
│ │ │ │ __init__. It is meant to provide the matcher author a way to
│ │ ├── ./usr/share/doc/python-betamax-doc/html/serializers.html
│ │ │ @@ -124,15 +124,15 @@
│ │ │
│ │ │
│ │ │ -
│ │ │ serialize(cassette_data)¶
│ │ │ A method that must be implemented by the Serializer author.
│ │ │
│ │ │ - Parameters:
│ │ │ -cassette_data (dict) – A dictionary with two keys:
│ │ │ +
cassette_data (dict) – A dictionary with two keys:
│ │ │ http_interactions
, recorded_with
.
│ │ │
│ │ │ - Returns:
│ │ │ Serialized data as a string.
│ │ │
│ │ │
│ │ │
│ │ │ @@ -164,20 +164,20 @@
│ │ │ deserialized_data = json.loads(cassette_data)
│ │ │ except ValueError:
│ │ │ deserialized_data = {}
│ │ │
│ │ │ return deserialized_data
│ │ │
│ │ │
│ │ │ -This is incredibly simple. We take advantage of the os.path
to properly
│ │ │ +
This is incredibly simple. We take advantage of the os.path
to properly
│ │ │ join the directory name and the file name. Betamax uses this method to find an
│ │ │ existing cassette or create a new one.
│ │ │ Next we have the betamax.serializers.JSONSerializer.serialize()
which
│ │ │ takes the cassette dictionary and turns it into a string for us. Here we are
│ │ │ -just leveraging the json
module and its ability to dump any valid
│ │ │ +just leveraging the json
module and its ability to dump any valid
│ │ │ dictionary to a string.
│ │ │ Finally, there is the
│ │ │ betamax.serializers.JSONSerializer.deserialize()
method which takes a
│ │ │ string and turns it into the dictionary that betamax needs to function.
│ │ │
│ │ │
│ │ │ ├── html2text {}
│ │ │ │ @@ -65,15 +65,15 @@
│ │ │ │ The return value is not checked and this is called at the end of
│ │ │ │ __init__. It is meant to provide the matcher author a way to
│ │ │ │ perform things during initialization of the instance that would
│ │ │ │ otherwise require them to override BaseSerializer.__init__.
│ │ │ │ serialize(ccaasssseettttee__ddaattaa)_¶
│ │ │ │ A method that must be implemented by the Serializer author.
│ │ │ │ Parameters:
│ │ │ │ - ccaasssseettttee__ddaattaa (_dd_ii_cc_tt) – A dictionary with two keys:
│ │ │ │ + ccaasssseettttee__ddaattaa (ddiicctt) – A dictionary with two keys:
│ │ │ │ http_interactions, recorded_with.
│ │ │ │ Returns:
│ │ │ │ Serialized data as a string.
│ │ │ │ Here’s the default (JSON) serializer as an example:
│ │ │ │ from .base import BaseSerializer
│ │ │ │
│ │ │ │ import json
│ │ │ │ @@ -96,20 +96,20 @@
│ │ │ │ def deserialize(self, cassette_data):
│ │ │ │ try:
│ │ │ │ deserialized_data = json.loads(cassette_data)
│ │ │ │ except ValueError:
│ │ │ │ deserialized_data = {}
│ │ │ │
│ │ │ │ return deserialized_data
│ │ │ │ -This is incredibly simple. We take advantage of the _o_s_._p_a_t_h to properly join
│ │ │ │ +This is incredibly simple. We take advantage of the os.path to properly join
│ │ │ │ the directory name and the file name. Betamax uses this method to find an
│ │ │ │ existing cassette or create a new one.
│ │ │ │ Next we have the betamax.serializers.JSONSerializer.serialize() which takes the
│ │ │ │ cassette dictionary and turns it into a string for us. Here we are just
│ │ │ │ -leveraging the _j_s_o_n module and its ability to dump any valid dictionary to a
│ │ │ │ +leveraging the json module and its ability to dump any valid dictionary to a
│ │ │ │ string.
│ │ │ │ Finally, there is the betamax.serializers.JSONSerializer.deserialize() method
│ │ │ │ which takes a string and turns it into the dictionary that betamax needs to
│ │ │ │ function.
│ │ │ │ ************ _BB_ee_tt_aa_mm_aa_xx ************
│ │ │ │ ******** NNaavviiggaattiioonn ********
│ │ │ │ Narrative Documentation