Skip to content
Myr

Make a dummy test

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by tzickel · committed by tzickel · parent fb23070 · Browse files · 1 file+6 added−9 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+6 added−9 removed

  • tests:+6 added−9 removed

1 file+6 added−9 removed

modified:tests/test_requests.py+6 added-9 removed
482 unmodified lines
483 requests.post(url, files=['bad file data'])484485 def test_POSTBIN_SEEKED_OBJECT_WITH_NO_ITER(self, httpbin):486487 class BufferedStream(object):487 class TestStream(object):488 def __init__(self, data):489 if isinstance(data, buffer):490 self.data = data489 self.data = data.encode()491 else:492 self.data = buffer(data)490 self.length = len(self.data)491 self.index = 0492493 def __len__(self):494 return self.length495496 def read(self, size=None):497 if size:501 ret = buffer(self.data, self.index, size)498 ret = self.data[self.index:self.index + size]499 self.index += size500 else:504 ret = buffer(self.data, self.index)501 ret = self.data[self.index:]502 self.index = self.length503 return ret504505 def tell(self):
6 unmodified lines
512 self.index += offset513 elif where == 2:514 self.index = self.length + offset515519 test = BufferedStream('test')516 test = TestStream('test')517 post1 = requests.post(httpbin('post'), data=test)518 assert post1.status_code == 200519 assert post1.json()['data'] == 'test'520524 test = BufferedStream('test')521 test = TestStream('test')522 test.seek(2)523 post2 = requests.post(httpbin('post'), data=test)524 assert post2.status_code == 200525 assert post2.json()['data'] == 'st'
1052 unmodified lines