Skip to content
Snippets Groups Projects
Commit b5813e2a authored by Alexander Schlemmer's avatar Alexander Schlemmer
Browse files

ENH: add fixtures to unit tests

parent c1a6d8af
No related branches found
No related tags found
1 merge request!53Release 0.1
......@@ -204,9 +204,6 @@ class Crawler(object):
for i in reversed(range(len(updateList))):
record = updateList[i]
if record.parents[0].name == "Measurement":
breakpoint()
# resolve references first:
self.identifiableAdapter.resolve_references(record)
identifiable = self.identifiableAdapter.retrieve_identifiable(record)
......
......@@ -12,13 +12,9 @@ import yaml
import caosdb as db
from caosdb.apiutils import compare_entities
import pytest
from pytest import raises
# Some notes:
# Track provenance information in two ways:
# - DONE: provenance in structure elements and converters for properties of records
# - TODO: list whether information from structure elements and converters was used
def rfp(*pathcomponents):
"""
......@@ -35,6 +31,13 @@ def dircheckstr(*pathcomponents):
return "newcrawler.structure_elements.Directory: " + basename(join(*pathcomponents)) + ", " + rfp("test_directories", "examples_article", *pathcomponents)
@pytest.fixture
def crawler():
crawler = Crawler(debug=True)
crawler.crawl_directory(rfp("test_directories", "examples_article"),
rfp("scifolder_cfood.yml"))
def test_crawler():
crawler = Crawler(debug=True)
crawler.crawl_directory(rfp("test_directories", "examples_article"),
......@@ -294,7 +297,6 @@ def test_crawler_update_list():
assert len(comp[1]["properties"]) == 0
insl, updl = crawler.synchronize(crawler.updateList)
breakpoint()
assert len(insl) == 0
assert len(updl) == 0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment