~ubuntuone-control-tower/ubuntuone-storage-protocol/stable-1-6

« back to all changes in this revision

Viewing changes to tests/test_upload_offset.py

  • Committer: Tarmac
  • Author(s): Rodney Dawes
  • Date: 2010-11-16 15:10:48 UTC
  • mfrom: (121.1.4 use-packages)
  • Revision ID: tarmac-20101116151048-b0e20j7lorb4yhe1
Switch to using packaged mocker and ubuntuone-dev-tools
Use pyflakes with u1lint and also run pep8
Fix a lot of pylint/pyflakes/pep8 errors

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
from ubuntuone.storageprotocol.request import RequestHandler
23
23
from ubuntuone.storageprotocol.client import PutContent
24
24
from ubuntuone.storageprotocol import protocol_pb2
25
 
from contrib.mocker import Mocker, ANY
 
25
from mocker import Mocker, ANY
 
26
 
26
27
 
27
28
class TestOffset(unittest.TestCase):
28
29
    """
38
39
        transport = mocker.mock()
39
40
        transport.registerProducer(ANY, streaming=True)
40
41
        transport.write(ANY)
41
 
        mocker.count(1, None) # I don't really care how many times
 
42
        mocker.count(1, None)  # I don't really care how many times
42
43
        fd = mocker.mock()
43
 
        fd.seek(offset) # this is really all I care about
 
44
        fd.seek(offset)  # this is really all I care about
44
45
        fd.read(ANY)
45
46
        mocker.result('')
46
47
        mocker.replay()
63
64
        transport = mocker.mock()
64
65
        transport.registerProducer(ANY, streaming=True)
65
66
        transport.write(ANY)
66
 
        mocker.count(1, None) # I don't really care how many times
 
67
        mocker.count(1, None)  # I don't really care how many times
67
68
        fd = mocker.mock()
68
 
        fd.seek(0) # this is really all I care about
 
69
        fd.seek(0)  # this is really all I care about
69
70
        fd.read(ANY)
70
71
        mocker.result('')
71
72
        mocker.replay()