From ee7528413edd02b033032ebc484a41e5650f0d4b Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Fri, 8 Jan 2021 11:54:02 -0500 Subject: [PATCH] update tests --- tests/unit/stream/test_reflector.py | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/tests/unit/stream/test_reflector.py b/tests/unit/stream/test_reflector.py index a02728c49..4a928e2d2 100644 --- a/tests/unit/stream/test_reflector.py +++ b/tests/unit/stream/test_reflector.py @@ -93,8 +93,7 @@ class TestReflector(AsyncioTestCase): await incoming.wait() stop.set() # this used to raise (and then propagate) a CancelledError - with self.assertRaises(asyncio.CancelledError): - await reflect_task + self.assertListEqual(await reflect_task, []) self.assertFalse(self.stream.is_fully_reflected) self.assertFalse(self.server_blob_manager.get_blob(self.stream.sd_hash).get_is_verified()) @@ -114,8 +113,8 @@ class TestReflector(AsyncioTestCase): await incoming.wait() await not_incoming.wait() stop.set() - with self.assertRaises(asyncio.CancelledError): - await reflect_task + sent = await reflect_task + self.assertListEqual([self.stream.sd_hash], sent) self.assertTrue(self.server_blob_manager.get_blob(self.stream.sd_hash).get_is_verified()) self.assertFalse(self.stream.is_fully_reflected) @@ -137,8 +136,8 @@ class TestReflector(AsyncioTestCase): await incoming.wait() await not_incoming.wait() stop.set() - with self.assertRaises(asyncio.CancelledError): - await reflect_task + sent = await reflect_task + self.assertListEqual([self.stream.sd_hash, self.stream.descriptor.blobs[0].blob_hash], sent) self.assertTrue(self.server_blob_manager.get_blob(self.stream.sd_hash).get_is_verified()) self.assertTrue(self.server_blob_manager.get_blob(self.stream.descriptor.blobs[0].blob_hash).get_is_verified()) self.assertFalse(self.stream.is_fully_reflected) @@ -160,9 +159,7 @@ class TestReflector(AsyncioTestCase): await not_incoming.wait() await incoming.wait() stop.set() - with self.assertRaises(asyncio.CancelledError): - await reflect_task - # self.assertListEqual(await reflect_task, [self.stream.sd_hash]) + self.assertListEqual(await reflect_task, [self.stream.sd_hash]) self.assertTrue(self.server_blob_manager.get_blob(self.stream.sd_hash).get_is_verified()) self.assertFalse( self.server_blob_manager.get_blob(self.stream.descriptor.blobs[0].blob_hash).get_is_verified() @@ -187,8 +184,8 @@ class TestReflector(AsyncioTestCase): await incoming.wait() await self.stream_manager.delete(self.stream, delete_file=True) # this used to raise OSError when it can't read the deleted blob for the upload - with self.assertRaises(asyncio.CancelledError): - await reflect_task + sent = await reflect_task + self.assertListEqual([self.stream.sd_hash], sent) self.assertTrue(self.server_blob_manager.get_blob(self.stream.sd_hash).get_is_verified()) self.assertFalse( self.server_blob_manager.get_blob(self.stream.descriptor.blobs[0].blob_hash).get_is_verified()