Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_file_report(enron_dataset_part012):
file = sorted(enron_dataset_part012.glob("*.pst"))[1]
with tempfile.TemporaryDirectory() as tmpdir:
out = Path(tmpdir) / "entities.sqlite3"
# Extract entities
assert 0 == subcommands.entities(
out=out,
spacy_model_name=SPACY_MODELS.en_core_web_sm,
jobs=2,
src=file,
progress=False,
)
# Connect to DB file
engine = create_engine(f"sqlite:////{out}")
session = sessionmaker(bind=engine)()
# There should be one FileReport instance for this run
file_report = session.query(FileReport).one() # pylint: disable=no-member
# Path
assert file_report.path == str(file)
# Name
default=SPACY_MODELS.en_core_web_sm,
)
@click.option(
"-m",
"--include-message-contents",
is_flag=True,
help="Also extract message headers and bodies.",
)
@click.option(
"-j",
"--jobs",
metavar=INT_METAVAR,
type=click.INT,
help=f"Use {INT_METAVAR} concurrent jobs.",
default=cpu_count(),
)
@click.argument(