10
10
class TestPullRequest (BaseTest ):
11
11
def __init__ (self , methodName = 'runTest' ):
12
12
super (TestPullRequest , self ).__init__ (methodName )
13
- repo = self .g .repository (self .sigm , self . todo )
14
- self .pr = repo .pull_request (5 )
13
+ repo = self .g .repository (self .kr , 'requests' )
14
+ self .pr = repo .pull_request (833 )
15
15
self .body = [
16
- 'I use this config setting to set the color for unprioritized items.' ,
17
- '' , 'export DEFAULT=$LIGHT_GREY' , '' ,
18
- ('Should be on both of my branches. Feel free to pull from me '
19
- "whenever - I'm not always in the mood to add a pull request."
20
- ' :-)' )
16
+ ('Use dicts and lists where necessary but accept both dicts and lists'
17
+ ' of' ), '2-tuples everywhere.'
21
18
]
22
19
self .body_html = [
23
20
('<p>'
24
- 'I use this config setting to set the color for unprioritized items.'
25
- '</p>' ),
26
- '' , '<p>export DEFAULT=$LIGHT_GREY</p>' , '' ,
27
- ('<p>Should be on both of my branches. Feel free to pull from me '
28
- "whenever - I'm not always in the mood to add a pull request."
29
- ' :-)</p>' )
21
+ 'Use dicts and lists where necessary but accept both dicts and lists'
22
+ ' of'
23
+ '<br>' ),
24
+ '2-tuples everywhere.</p>'
30
25
]
31
- self .url = 'https://github.com/{s.sigm}/{s.todo}/pull/5' .format (
32
- s = self )
26
+ self .url = 'https://github.com/{0}/requests/pull/5' .format (self .kr )
33
27
34
28
def test_pull_request (self ):
35
29
expect (self .pr ).isinstance (PullRequest )
36
30
37
31
def test_base (self ):
38
32
expect (self .pr .base ).is_not_None ()
39
33
expect (self .pr .base ).isinstance (PullDestination )
40
- expect (self .pr .base .label ) == 'sigmavirus24:master '
34
+ expect (self .pr .base .label ) == 'kennethreitz:develop '
41
35
42
36
def test_body (self ):
43
37
expect (self .pr .body ).isinstance (str_test )
44
- body = '\r \ n ' .join (self .body )
38
+ body = '\n ' .join (self .body )
45
39
expect (self .pr .body ) == body
46
40
47
41
def test_body_html (self ):
@@ -69,7 +63,7 @@ def test_head(self):
69
63
head = self .pr .head
70
64
label = head .label
71
65
expect (head ).isinstance (PullDestination )
72
- expect (label ) == 'jvstein:0171bf7bea88cac6884bb72bd26c07e6a826677e '
66
+ expect (label ) == 'sigmavirus24:fix_key_val_args '
73
67
74
68
def test_html_url (self ):
75
69
url = self .pr .html_url
@@ -130,12 +124,11 @@ def test_state(self):
130
124
expect (self .pr .state ) == 'closed'
131
125
132
126
def test_title (self ):
133
- expect (self .pr .title ) == ('Handle the DEFAULT config setting like'
134
- ' todo.sh' )
127
+ expect (self .pr .title ) == 'Fixes #817'
135
128
136
129
def test_user (self ):
137
130
expect (self .pr .user ).isinstance (User )
138
- expect (self .pr .user .login ) == 'jvstein'
131
+ expect (self .pr .user .login ) == self . sigm
139
132
140
133
def test_with_auth (self ):
141
134
if not self .auth :
@@ -212,8 +205,8 @@ def test_requires_auth(self):
212
205
class TestPullDestination (BaseTest ):
213
206
def __init__ (self , methodName = 'runTest' ):
214
207
super (TestPullDestination , self ).__init__ (methodName )
215
- repo = self .g .repository (self .sigm , self . todo )
216
- self .dest = repo .pull_request (5 ).base
208
+ repo = self .g .repository (self .kr , 'requests' )
209
+ self .dest = repo .pull_request (833 ).base
217
210
218
211
def test_pull_destination (self ):
219
212
expect (self .dest ).isinstance (PullDestination )
@@ -222,26 +215,26 @@ def test_direction(self):
222
215
expect (self .dest .direction ) == 'Base'
223
216
224
217
def test_label (self ):
225
- expect (self .dest .label ) == 'sigmavirus24:master '
218
+ expect (self .dest .label ) == 'kennethreitz:develop '
226
219
227
220
def test_sha (self ):
228
- expect (self .dest .sha ) == 'f55a45094f67d5659462c3fbb18d4bca97d92e7c '
221
+ expect (self .dest .sha ) == 'c8f166f696327dc8ec07a248863fcc35fafa2038 '
229
222
230
223
def test_ref (self ):
231
- expect (self .dest .ref ) == 'master '
224
+ expect (self .dest .ref ) == 'develop '
232
225
233
226
def test_repo (self ):
234
- expect (self .dest .repo ) == (self .sigm , self . todo )
227
+ expect (self .dest .repo ) == (self .kr , 'requests' )
235
228
236
229
def test_user (self ):
237
- expect (self .dest .user .login ) == self .sigm
230
+ expect (self .dest .user .login ) == self .kr
238
231
239
232
240
233
class TestPullFile (BaseTest ):
241
234
def __init__ (self , methodName = 'runTest' ):
242
235
super (TestPullFile , self ).__init__ (methodName )
243
- repo = self .g .repository (self .sigm , self . todo )
244
- self .pf = repo .pull_request (5 ).list_files ()[0 ]
236
+ repo = self .g .repository (self .kr , 'requests' )
237
+ self .pf = repo .pull_request (833 ).list_files ()[0 ]
245
238
246
239
def test_file (self ):
247
240
expect (self .pf ).isinstance (PullFile )
@@ -252,16 +245,16 @@ def test_additions(self):
252
245
def test_blob_url (self ):
253
246
expect (self .pf .blob_url ).isinstance (str_test )
254
247
expect ('blob' in self .pf .blob_url ).is_True ()
255
- expect ('todo .py' in self .pf .blob_url ).is_True ()
248
+ expect ('compat .py' in self .pf .blob_url ).is_True ()
256
249
257
250
def test_changes (self ):
258
- expect (self .pf .changes ) == 4
251
+ expect (self .pf .changes ) == 2
259
252
260
253
def test_deletions (self ):
261
- expect (self .pf .deletions ) == 2
254
+ expect (self .pf .deletions ) == 0
262
255
263
256
def test_filename (self ):
264
- expect (self .pf .filename ) == 'todo .py'
257
+ expect (self .pf .filename ) == 'requests/compat .py'
265
258
266
259
def test_patch (self ):
267
260
expect (self .pf .patch ).isinstance (str_test )
@@ -270,7 +263,7 @@ def test_raw_url(self):
270
263
expect (self .pf .raw_url ) == self .pf .blob_url .replace ('blob' , 'raw' )
271
264
272
265
def test_sha (self ):
273
- expect (self .pf .sha ) == 'd9024b5b8a078011f8d1de7ec8c15218c9c9449b '
266
+ expect (self .pf .sha ) == '351b7c6e03070523b963d9adc71ef2b89a0fa574 '
274
267
275
268
def test_status (self ):
276
269
expect (self .pf .status ) == 'modified'
0 commit comments