def test_calc_s3_files_without_formatter(mocked_s3): """Should return parsed object keys for source and all destinations without formatter.""" gen = lambda: transfer.calc_s3_files("2020-01-01/collection_name.csv.gz", mocked_s3) # noqa assert [f.key for f in gen()] == ["2020-01-01/collection_name.csv.gz"] * 4 assert [f.client.name for f in gen() ] == ["source", "destination.0", "destination.1", "destination.2"]
def test_calc_s3_files(mocked_s3): """Should return parsed object keys for source and all destinations with formatter.""" gen = lambda: transfer.calc_s3_files("2020-01-01/collection_name.csv.gz", mocked_s3) # noqa assert [(f.client.name, f.key) for f in gen()] == [ ("source", "2020-01-01/collection_name.csv.gz"), ("destination.0", "collection_name/historic/2020-01-01-collection_name.csv"), ("destination.1", "collection_name/latest/full_data.csv"), ("destination.2", "2020-01-01/collection_name.csv.gz"), ]