@unittest.skipIf((snappy is None), 'python-snappy not installed.')
def test_sink_transform_snappy(self):
    with tempfile.NamedTemporaryFile() as dst:
        path = dst.name
        with TestPipeline() as p:
            ((p | beam.Create(self.RECORDS)) | avroio.WriteToAvro(path, self.SCHEMA, codec='snappy', use_fastavro=self.use_fastavro))
        with TestPipeline() as p:
            readback = ((p | avroio.ReadFromAvro((path + '*'), use_fastavro=self.use_fastavro)) | beam.Map(json.dumps))
            assert_that(readback, equal_to([json.dumps(r) for r in self.RECORDS]))
@unittest.skipIf((snappy is None), 'python-snappy not installed.')
def test_sink_transform_snappy(self):
    with tempfile.NamedTemporaryFile() as dst:
        path = dst.name
        with TestPipeline() as p:
            ((p | beam.Create(self.RECORDS)) | avroio.WriteToAvro(path, self.SCHEMA, codec='snappy', use_fastavro=self.use_fastavro))
        with TestPipeline() as p:
            readback = ((p | avroio.ReadFromAvro((path + '*'), use_fastavro=self.use_fastavro)) | beam.Map(json.dumps))
            assert_that(readback, equal_to([json.dumps(r) for r in self.RECORDS]))