def test_basic(self): target = ValueTarget() self.assertEqual(target.value, b'') target.multipart_filename = None target.start() self.assertTrue(target.multipart_filename is None) self.assertEqual(target.value, b'') target.data_received(b'hello') target.data_received(b' ') target.data_received(b'world') target.finish() self.assertTrue(target.multipart_filename is None) self.assertEqual(target.value, b'hello world')
def test_value_target_basic(): target = ValueTarget() assert target.value == b'' target.multipart_filename = None target.start() assert target.multipart_filename is None assert target.value == b'' target.data_received(b'hello') target.data_received(b' ') target.data_received(b'world') target.finish() assert target.multipart_filename is None assert target.value == b'hello world'