[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [stem/master] Drop zstd from CollecTor unit tests
commit ae1970e2d8f25c097a61a48347a520d25314a5bc
Author: Damian Johnson <atagar@xxxxxxxxxxxxxx>
Date: Fri Jul 5 14:49:15 2019 -0700
Drop zstd from CollecTor unit tests
Oops! Just remembered why I didn't originally include zstd tests. CollecTor
doesn't do zstd compression (just tor's DirPort).
---
test/unit/descriptor/collector.py | 16 +---------------
1 file changed, 1 insertion(+), 15 deletions(-)
diff --git a/test/unit/descriptor/collector.py b/test/unit/descriptor/collector.py
index cfb57c3d..260e246b 100644
--- a/test/unit/descriptor/collector.py
+++ b/test/unit/descriptor/collector.py
@@ -76,20 +76,6 @@ class TestCollector(unittest.TestCase):
urlopen_mock.assert_called_with('https://collector.torproject.org/index/index.json.lzma', timeout = None)
@patch(URL_OPEN)
- def test_download_zstd(self, urlopen_mock):
- if not Compression.ZSTD.available:
- self.skipTest('(zstd compression unavailable)')
- return
-
- import zstd
- compressor = zstd.ZstdCompressor()
- urlopen_mock.return_value = io.BytesIO(compressor.compress(MINIMAL_INDEX_JSON))
-
- collector = CollecTor(compression = Compression.ZSTD)
- self.assertEqual(MINIMAL_INDEX, collector.index())
- urlopen_mock.assert_called_with('https://collector.torproject.org/index/index.json.zst', timeout = None)
-
- @patch(URL_OPEN)
def test_download_retries(self, urlopen_mock):
urlopen_mock.side_effect = IOError('boom')
@@ -118,7 +104,7 @@ class TestCollector(unittest.TestCase):
self.assertRaisesRegexp(ValueError, 'No JSON object could be decoded', collector.index)
def test_index_malformed_compression(self):
- for compression in (Compression.GZIP, Compression.BZ2, Compression.LZMA, Compression.ZSTD):
+ for compression in (Compression.GZIP, Compression.BZ2, Compression.LZMA):
if not compression.available:
next
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits