public async Task FileInSitePackageMissing() { var files = BasicFiles; using (var libDb = new TemporaryLibAndDB(files)) using (var analyzer = libDb.Analyzer) { libDb.DeleteLibrary("site-packages\\B\\b.py"); Assert.IsFalse(await analyzer.Prepare(true)); Assert.AreEqual(files.Count() - 1, libDb.FilesInDatabase.Count()); Assert.AreEqual(0, analyzer._analyzeFileGroups.Count); Assert.AreEqual(0, analyzer._scrapeFileGroups.Count); } }
public async Task FileInStdLibMissing() { var files = BasicFiles; using (var libDb = new TemporaryLibAndDB(files)) using (var analyzer = libDb.Analyzer) { libDb.DeleteLibrary("a.py"); Assert.IsFalse(await analyzer.Prepare(true)); // This is the result we'd expect. //Assert.AreEqual(files.Count() - 1, libDb.FilesInDatabase.Count()) // But because we don't provide an interpreter here, no files // from the top-level database directory will ever be deleted. // Otherwise, sys.builtin_module_names is used to determine // which files to keep. Assert.AreEqual(files.Count(), libDb.FilesInDatabase.Count()); Assert.AreEqual(0, analyzer._analyzeFileGroups.Count); Assert.AreEqual(0, analyzer._scrapeFileGroups.Count); } }