~mterry/duplicity/gdrive

« back to all changes in this revision

Viewing changes to testing/unit/test_patchdir.py

  • Committer: Kenneth Loafman
  • Date: 2015-01-31 23:30:49 UTC
  • Revision ID: kenneth@loafman.com-20150131233049-8deeiaxgt0rq2bu6
* Misc fixes for the following PEP8 issues:
  - E231, E241, E251, E261, E262, E271, E272, E301, E302, E303, E502,
    E701, E702, E703, E711, E721, W291, W292, W293, W391
  - see http://pep8.readthedocs.org

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
        blocksize = 32 * 1024
45
45
        while 1:
46
46
            buf = infp.read(blocksize)
47
 
            if not buf: break
 
47
            if not buf:
 
48
                break
48
49
            outfp.write(buf)
49
50
        assert not infp.close()
50
51
        assert not outfp.close()
75
76
                diffdir.write_block_iter(sigblock, sig)
76
77
                deltablock = diffdir.DirDelta(self.get_sel(new_path),
77
78
                                              sig.open("rb"))
78
 
            else: deltablock = diffdir.DirFull(self.get_sel(new_path))
 
79
            else:
 
80
                deltablock = diffdir.DirFull(self.get_sel(new_path))
79
81
            diffdir.write_block_iter(deltablock, diff)
80
82
 
81
83
            patchdir.Patch(seq_path, diff.open("rb"))
94
96
 
95
97
        tf = patchdir.TarFile_FromFileobjs(get_fileobjs())
96
98
        namelist = []
97
 
        for tarinfo in tf: namelist.append(tarinfo.name)
 
99
        for tarinfo in tf:
 
100
            namelist.append(tarinfo.name)
98
101
        for i in range(1, 6):
99
102
            assert ("tmp/%d" % i) in namelist, namelist
100
103
 
130
133
    def __init__(self, index):
131
134
        self.index = index
132
135
 
 
136
 
133
137
class CollateItersTest(UnitTestCase):
134
138
    def setUp(self):
135
139
        super(CollateItersTest, self).setUp()
192
196
    def check_output(self):
193
197
        """Make sure testfiles/output exists"""
194
198
        out = Path("testfiles/output")
195
 
        if not (out.exists() and out.isdir()): out.mkdir()
 
199
        if not (out.exists() and out.isdir()):
 
200
            out.mkdir()
196
201
        self.out = out
197
202
 
198
203
    def snapshot(self):