File tree Expand file tree Collapse file tree 3 files changed +14
-5
lines changed Expand file tree Collapse file tree 3 files changed +14
-5
lines changed Original file line number Diff line number Diff line change 1
1
import base64
2
2
import betamax
3
3
import os
4
+ import pytest
4
5
5
6
from betamax_matchers import json_body
6
7
29
30
'<BASIC_AUTH>' ,
30
31
base64 .b64encode (b':' .join (credentials )).decode ()
31
32
)
33
+
34
+
35
+ @pytest .fixture
36
+ def betamax_simple_body (request ):
37
+ """Return configuration to match cassette on uri, method and body."""
38
+ request .cls .betamax_simple_body = {
39
+ 'match_requests_on' : ['uri' , 'method' , 'body' ]
40
+ }
Original file line number Diff line number Diff line change 2
2
import betamax
3
3
import github3
4
4
import os
5
+ import pytest
5
6
import unittest
6
7
7
8
9
+ @pytest .mark .usefixtures ('betamax_simple_body' )
8
10
class IntegrationHelper (unittest .TestCase ):
9
11
def setUp (self ):
10
12
self .user = os .environ .get ('GH_USER' , 'foo' )
Original file line number Diff line number Diff line change @@ -360,13 +360,11 @@ def test_organization(self):
360
360
assert isinstance (o , github3 .orgs .Organization )
361
361
362
362
def test_pubsubhubbub (self ):
363
- """Test the ability to createa a pubsubhubbub hook."""
363
+ """Test the ability to create a pubsubhubbub hook."""
364
364
self .token_login ()
365
- betamax_kwargs = {
366
- 'match_requests_on' : ['uri' , 'method' , 'body' ]
367
- }
368
365
cassette_name = self .cassette_name ('pubsubhubbub' )
369
- with self .recorder .use_cassette (cassette_name , ** betamax_kwargs ):
366
+ with self .recorder .use_cassette (cassette_name ,
367
+ ** self .betamax_simple_body ):
370
368
topic = 'https://github.com/itsmemattchung/github3.py/events/push'
371
369
status = self .gh .pubsubhubbub (
372
370
mode = 'subscribe' ,
You can’t perform that action at this time.
0 commit comments