Skip to content

Commit

Permalink
Update moto to 1.x milestone version (#2471)
Browse files Browse the repository at this point in the history
  • Loading branch information
dlstadther authored and Tarrasch committed Aug 16, 2018
1 parent 4ab2a90 commit 9b610b4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
13 changes: 8 additions & 5 deletions test/contrib/s3_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,23 +95,26 @@ def test_read_iterator_long(self):
tempf = tempfile.NamedTemporaryFile(mode='wb', delete=False)
temppath = tempf.name
firstline = ''.zfill(key.Key.BufferSize * 5) + os.linesep
contents = firstline + 'line two' + os.linesep + 'line three'
secondline = 'line two' + os.linesep
thirdline = 'line three' + os.linesep
contents = firstline + secondline + thirdline
tempf.write(contents.encode('utf-8'))
tempf.close()

client = S3Client(AWS_ACCESS_KEY, AWS_SECRET_KEY)
create_bucket()
client.put(temppath, 's3://mybucket/largetempfile')
t = S3Target('s3://mybucket/largetempfile', client=client)
remote_path = 's3://mybucket/largetempfile'
client.put(temppath, remote_path)
t = S3Target(remote_path, client=client)
with t.open() as read_file:
lines = [line for line in read_file]
finally:
key.Key.BufferSize = old_buffer

self.assertEqual(3, len(lines))
self.assertEqual(firstline, lines[0])
self.assertEqual("line two" + os.linesep, lines[1])
self.assertEqual("line three", lines[2])
self.assertEqual(secondline, lines[1])
self.assertEqual(thirdline, lines[2])

def test_get_path(self):
t = self.create_target()
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ usedevelop = True
install_command = pip install {opts} {packages}
deps=
mock<2.0
moto<1.0
moto<2.0
HTTPretty==0.8.10
nose<2.0
docker>=2.1.0
Expand Down

0 comments on commit 9b610b4

Please sign in to comment.