def test_db(tmp_path): manifest = load_qiime_manifest(db) tax = md.test_taxonomy() manifest.file = tax.file[0] built = build_database(manifest, str(tmp_path), rank="species") assert built.shape[0] == 3 for fi in built.file: assert (tmp_path / fi).exists() built = build_database(manifest, str(tmp_path / "db.zip")) assert (tmp_path / "db.zip").exists()
def test_qiime_model(): manifest = qf.load_qiime_manifest(models) assert "sample_id" in manifest.columns for i in manifest.sample_id: com = qf.load_qiime_model(models, i) assert len(com.abundances) == 3 assert com.optimize().growth_rate == approx(0.874, 0.001) with raises(ValueError): qf.load_qiime_model(models, "blub") with raises(ValueError): qf.load_qiime_model(db, "blub")
def test_bad_manifest(): with raises(ValueError): manifest = qf.load_qiime_manifest(medium)
def test_good_manifest(arti): manifest = qf.load_qiime_manifest(arti) assert "file" in manifest.columns