예제 #1
0
    def test_decompress(self):
        md5_hash = mock.Mock(spec=['update'])
        decoder = download_mod._GzipDecoder(md5_hash)

        data = b'\x1f\x8b\x08\x08'
        result = decoder.decompress(data)

        assert result == b''
        md5_hash.update.assert_called_once_with(data)
예제 #2
0
 def test_constructor(self):
     decoder = download_mod._GzipDecoder(mock.sentinel.md5_hash)
     assert decoder._md5_hash is mock.sentinel.md5_hash