Commit 64f60331 authored by Sridhar's avatar Sridhar
Browse files

updated .gitignore

parent 6eb7a7a2
Pipeline #12299 canceled with stages
ingest/
pycache
*.pyc
*.pyo
*.pyd
.Python
env
venv
.venv
pip-log.txt
pip-delete-this-directory.txt
.tox
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.log
.git
.mypy_cache
.pytest_cache
.hypotheses
logs/
.env
FROM python:3.11-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
CMD ["python", "data_fetch.py"]
import os
import json
from document_writer import DocumentWriter
from document import Document
def test_document_writer(tmp_path):
content = """beep
boop
bop
bim"""
name = "test.txt"
title = "hello !"
creation_date = 1761763703219
test_document = Document()
test_document.set_name(name)
test_document.set_title(title)
test_document.set_main_content(content)
test_document.set_attribute("creation_date", creation_date)
writer = DocumentWriter(tmp_path)
writer.write_document(test_document)
with open(os.path.join(tmp_path, name)) as f:
assert f.read() == content
with open(os.path.join(tmp_path, ".meta", name + ".json")) as f:
meta = json.loads(f.read())
assert meta["title"] == title
assert meta["backlink"] == os.path.join(tmp_path, name)
assert meta["properties"] != None
assert meta["properties"]["creation_date"] == 1761763703219
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment