File: PKG-INFO

package info (click to toggle)
betamax 0.8.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 668 kB
  • sloc: python: 2,661; makefile: 125; sh: 13
file content (343 lines) | stat: -rw-r--r-- 12,806 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
Metadata-Version: 1.1
Name: betamax
Version: 0.8.1
Summary: A VCR imitation for python-requests
Home-page: https://github.com/sigmavirus24/betamax
Author: Ian Stapleton Cordasco
Author-email: graffatcolmingov@gmail.com
License: Apache 2.0
Description-Content-Type: UNKNOWN
Description: betamax
        =======
        
        Betamax is a VCR_ imitation for requests. This will make mocking out requests
        much easier. It is tested on `Travis CI`_.
        
        Put in a more humorous way: "Betamax records your HTTP interactions so the NSA
        does not have to."
        
        Example Use
        -----------
        
        .. code-block:: python
        
            from betamax import Betamax
            from requests import Session
            from unittest import TestCase
        
            with Betamax.configure() as config:
                config.cassette_library_dir = 'tests/fixtures/cassettes'
        
        
            class TestGitHubAPI(TestCase):
                def setUp(self):
                    self.session = Session()
                    self.headers.update(...)
        
                # Set the cassette in a line other than the context declaration
                def test_user(self):
                    with Betamax(self.session) as vcr:
                        vcr.use_cassette('user')
                        resp = self.session.get('https://api.github.com/user',
                                                auth=('user', 'pass'))
                        assert resp.json()['login'] is not None
        
                # Set the cassette in line with the context declaration
                def test_repo(self):
                    with Betamax(self.session).use_cassette('repo'):
                        resp = self.session.get(
                            'https://api.github.com/repos/sigmavirus24/github3.py'
                            )
                        assert resp.json()['owner'] != {}
        
        What does it even do?
        ---------------------
        
        If you are unfamiliar with VCR_, you might need a better explanation of what
        Betamax does.
        
        Betamax intercepts every request you make and attempts to find a matching
        request that has already been intercepted and recorded. Two things can then
        happen:
        
        1. If there is a matching request, it will return the response that is
           associated with it.
        2. If there is **not** a matching request and it is allowed to record new
           responses, it will make the request, record the response and return the
           response.
        
        Recorded requests and corresponding responses - also known as interactions -
        are stored in files called cassettes. (An example cassette can be seen in
        the `examples section of the documentation`_.) The directory you store your
        cassettes in is called your library, or your `cassette library`_.
        
        VCR Cassette Compatibility
        --------------------------
        
        Betamax can use any VCR-recorded cassette as of this point in time. The only
        caveat is that python-requests returns a URL on each response. VCR does not
        store that in a cassette now but we will. Any VCR-recorded cassette used to
        playback a response will unfortunately not have a URL attribute on responses
        that are returned. This is a minor annoyance but not something that can be
        fixed.
        
        Contributing
        ------------
        
        You can check out the project board on waffle.io_ to see what the status of
        each issue is.
        
        .. _VCR: https://github.com/vcr/vcr
        .. _Travis CI: https://travis-ci.org/sigmavirus24/betamax
        .. _waffle.io: https://waffle.io/sigmavirus24/betamax
        .. _examples section of the documentation:
            http://betamax.readthedocs.org/en/latest/api.html#examples
        .. _cassette library:
            http://betamax.readthedocs.org/en/latest/cassettes.html
        
        
        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
        ------------------
        
        - Add ``betamax_parametrized_recorder`` and ``betamax_parametrized_session``
          to our list of pytest fixtures so that users will have parametrized cassette
          names when writing parametrized tests with our fixtures. (I wonder if I can
          mention parametrization a bunch more times so I can say parametrize a lot in
          this bullet note.)
        - Add ``ValidationError`` and a set of subclasses for each possible validation
          error.
        - Raise ``InvalidOption`` on unknown cassette options rather than silently
          ignoring extra options.
        - Raise a subclass of ``ValidationError`` when a particular cassette option is
          invalid, rather than silently ignoring the validation failure.
        
        0.7.2 - 2016-08-04
        ------------------
        
        - Fix bug with query string matcher where query-strings without values (e.g.,
          ``?foo&bar`` as opposed to ``?foo=1&bar=2``) were treated as if there were
          no query string.
        
        0.7.1 - 2016-06-14
        ------------------
        
        - Fix issue #108 by effectively copying the items in the match_requests_on
          list into the match_options set on a Cassette instance
        
        0.7.0 - 2016-04-29
        ------------------
        
        - Add ``before_record`` and ``before_playback`` hooks
        
        - Allow per-cassette placeholders to be merged and override global
          placeholders
        
        - Fix bug where the ``QueryMatcher`` failed matching on high Unicode points
        
        0.6.0 - 2016-04-12
        ------------------
        
        - Add ``betamax_recorder`` pytest fixture
        
        - Change default behaviour to allow duplicate interactions to be recorded in
          single cassette
        
        - Add ``allow_playback_repeats`` to allow an interaction to be used more than
          once from a single cassette
        
        - Always return a new ``Response`` object from an Interaction to allow for a
          streaming response to be usable multiple times
        
        - Remove CI support for Pythons 2.6 and 3.2
        
        0.5.1 - 2015-10-24
        ------------------
        
        - Fix bugs with requests 2.8.x integration
        
        - Fix bugs with older versions of requests that were missing an HTTPHeaderDict
          implementation
        
        0.5.0 - 2015-07-15
        ------------------
        
        - Add unittest integration in ``betamax.fixtures.unittest``
        
        - Add pytest integration in ``betamax.fixtures.pytest``
        
        - Add a decorator as a short cut for ``use_cassette``
        
        - Fix bug where body bytes were not always encoded on Python 3.2+
        
          Fixed by @bboe
        
        0.4.2 - 2015-04-18
        ------------------
        
        - Fix issue #58 reported by @bboe
        
          Multiple cookies were not being properly stored or replayed after being
          recorded.
        
        - @leighlondon converted ``__all__`` to a tuple
        
        0.4.1 - 2014-09-24
        ------------------
        
        - Fix issue #39 reported by @buttscicles
        
          This bug did not properly parse the Set-Cookie header with multiple cookies
          when replaying a recorded response.
        
        0.4.0 - 2014-07-29
        ------------------
        
        - Allow the user to pass placeholders to ``Betamax#use_cassette``.
        
        - Include Betamax's version number in cassettes
        
        0.3.2 - 2014-06-05
        ------------------
        
        - Fix request and response bodies courtesy of @dgouldin
        
        0.3.1 - 2014-05-28
        ------------------
        
        - Fix GitHub Issue #35 - Placeholders were not being properly applied to
          request bodies. This release fixes that so placeholders are now behave as
          expected with recorded request bodies.
        
        0.3.0 - 2014-05-23
        ------------------
        
        - Add ``Betamax#start`` and ``Betamax#stop`` to allow users to start recording
          and stop without using a context-manager.
        
        - Add ``digest-auth`` matcher to help users match the right request when using
          requests' ``HTTPDigestAuth``.
        
        - Reorganize and refactor the cassettes, matchers, and serializers modules.
        
        - Refactor some portions of code a bit.
        
        - ``Cassette.cassette_name`` no longer is the relative path to the file in
          which the cassette is saved. To access that information use
          ``Cassette.cassette_path``. The ``cassette_name`` attribute is now the name
          that you pass to ``Betamax#use_cassette``.
        
        0.2.0 - 2014-04-12
        ------------------
        
        - Fix bug where new interactions recorded under ``new_episodes`` or ``all``
          were not actually saved to disk.
        
        - Match URIs in a far more intelligent way.
        
        - Use the Session's original adapters when making new requests
        
          In the event the Session has a custom adapter mounted, e.g., the SSLAdapter
          in requests-toolbelt, then we should probably use that.
        
        - Add ``on_init`` hook to ``BaseMatcher`` so matcher authors can customize
          initialization
        
        - Add support for custom Serialization formats. See the docs for more info.
        
        - Add support for preserving exact body bytes.
        
        - Deprecate ``serialize`` keyword to ``Betamax#use_cassette`` in preference
          for ``serialize_with`` (to be more similar to VCR).
        
        0.1.6 - 2013-12-07
        ------------------
        
        - Fix how global settings and per-invocation options are persisted and
          honored. (#10)
        
        - Support ``match_requests_on`` as a parameter sent to
          ``Betamax#use_cassette``. (No issue)
        
        0.1.5 - 2013-09-27
        ------------------
        
        - Make sure what we pass to ``base64.b64decode`` is a bytes object
        
        0.1.4 - 2013-09-27
        ------------------
        
        - Do not try to sanitize something that may not exist.
        
        0.1.3 - 2013-09-27
        ------------------
        
        - Fix issue when response has a Content-Encoding of gzip and we need to
          preserve the original bytes of the message.
        
        0.1.2 - 2013-09-21
        ------------------
        
        - Fix issues with how requests parses cookies out of responses
        
        - Fix unicode issues with ``Response#text`` (trying to use ``Response#json``
          raises exception because it cannot use string decoding on a unicode string)
        
        0.1.1 - 2013-09-19
        ------------------
        
        - Fix issue where there is a unicode character not in ``range(128)``
        
        0.1.0 - 2013-09-17
        ------------------
        
        - Initial Release
        
        - Support for VCR generated cassettes (JSON only)
        
        - Support for ``re_record_interval``
        
        - Support for the ``once``, ``all``, ``new_episodes``, ``all`` cassette modes
        
        - Support for filtering sensitive data
        
        - Support for the following methods of request matching:
        
          - Method
        
          - URI
        
          - Host
        
          - Path
        
          - Query String
        
          - Body
        
          - Headers
        
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: Implementation :: CPython