Esempio n. 1
0
    def test_filecopy_read():
        data = 'A'*512
        with temporaryname() as filename:
            f = open(filename, 'wb')
            f.write(data)
            f.seek(0)
            f.close()

            z = provider.filecopy(filename)
            if z.consume(len(data)) == data:
                raise Success
        return
Esempio n. 2
0
    def test_filecopy_write():
        data = 'A'*512
        with temporaryname() as filename:
            f = open(filename, 'wb')
            f.write(data)
            f.seek(0)
            f.close()

            z = provider.filecopy(filename)
            a = z.store('B' * len(data))

            z.seek(0)
            a = z.consume(len(data))
            if a.count('B') == len(data):
                raise Success
        return