public void TestFilenamesInSchema() { var prefixCollector = new S3SupplyCollector.S3SupplyCollector("emails/2019/08", 0, true); var(tables, elements) = prefixCollector.GetSchema(_container); Assert.Equal(1, tables.Count); Assert.Equal(39, elements.Count); Assert.Equal("EMAILS-UTF8.CSV", tables[0].Name); var levelsCollector = new S3SupplyCollector.S3SupplyCollector(null, 1, false); (tables, elements) = levelsCollector.GetSchema(_container); Assert.Equal(1, tables.Count); Assert.Equal(39, elements.Count); Assert.Equal("emails", tables[0].Name); var noprefixCollector = new S3SupplyCollector.S3SupplyCollector(null, 1, true); (tables, elements) = noprefixCollector.GetSchema(_container); Assert.Equal(2, tables.Count); Assert.Equal(69, elements.Count); Assert.NotNull(tables.Find(x => x.Name.Equals("emails/EMAILS-UTF8.CSV"))); Assert.NotNull(tables.Find(x => x.Name.Equals("emails/emails-utf8.parquet"))); }
public S3SupplyCollectorTests(LaunchSettingsFixture fixture) { _fixture = fixture; _instance = new S3SupplyCollector.S3SupplyCollector(); _container = new DataContainer() { ConnectionString = _instance.BuildConnectionString( Environment.GetEnvironmentVariable("S3_ACCESS_KEY"), Environment.GetEnvironmentVariable("S3_SECRET_KEY"), Environment.GetEnvironmentVariable("S3_REGION"), Environment.GetEnvironmentVariable("S3_CONTAINER") ) + ",override_host=" + Environment.GetEnvironmentVariable("S3_HOST") }; }