diff --git a/unittests/test_converters.py b/unittests/test_converters.py index b9a730c226bb25fd97b23cd39f61d2237758de91..a862c26bc8638e66ca01441523cdfef4af267f43 100644 --- a/unittests/test_converters.py +++ b/unittests/test_converters.py @@ -64,9 +64,15 @@ def testDirectoryConverter(): Directory("test_directories", rfp("test_directories"))) # Check whether the right structure elements were created - assert len(elements) == 1 - assert isinstance(elements[0], Directory) - assert elements[0].name == "examples_article" + # this has been updated, there are more directories now + # assert len(elements) == 1 + element_names = [] + for element in elements: + assert isinstance(element, Directory) + element_names.append(element.name) + assert "examples_article" in element_names + assert "example_overwrite_1" in element_names + assert "example_insert" in element_names def test_markdown_converter(): diff --git a/unittests/test_directories/example_insert/SimulationData/2020_climate-model-predict/2022-01-14/README.md b/unittests/test_directories/example_insert/SimulationData/2020_climate-model-predict/2022-01-14/README.md new file mode 100644 index 0000000000000000000000000000000000000000..cb9437486636054377ac3020445345268c12fe1d --- /dev/null +++ b/unittests/test_directories/example_insert/SimulationData/2020_climate-model-predict/2022-01-14/README.md @@ -0,0 +1,26 @@ +--- +responsible: AuthorE +description: > + Code for fitting the predictive model to the + training data and for predicting the average + annual temperature for all measurement stations + for the years 2010 to 2019. + This is a second run of the same simulation from 2020-02-01 to check replication. +sources: +- ../../../ExperimentalData/2020_climate-model-predict/1980-01-01/temperatures-*.csv +- ../../../ExperimentalData/2020_climate-model-predict/1990-01-01/temperatures-*.csv +- ../../../ExperimentalData/2020_climate-model-predict/2000-01-01/temperatures-*.csv +- ../2020-02-01/ +results: +- file: params.json + description: Model parameters for the best fit to the training set +- file: predictions-201*.csv + description: Annual temperature predictions with geographical locations +scripts: +- file: model.py + description: python module with the model equations +- file: fit_parameters.py + description: Fit model parameters to training data using a basinhopping optimizer +- file: predict.py + description: Use optimized parameters to simulate average temperatures from 2010 to 2019 +... diff --git a/unittests/test_directories/example_overwrite_1/SimulationData/2020_climate-model-predict/2022-01-14/README.md b/unittests/test_directories/example_overwrite_1/SimulationData/2020_climate-model-predict/2022-01-14/README.md new file mode 100644 index 0000000000000000000000000000000000000000..e39fef19e2aa8e131e4c57697f583520b8e42be7 --- /dev/null +++ b/unittests/test_directories/example_overwrite_1/SimulationData/2020_climate-model-predict/2022-01-14/README.md @@ -0,0 +1,26 @@ +--- +responsible: AuthorE +description: > + Code for fitting the predictive model to the + training data and for predicting the average + annual temperature for all measurement stations + for the years 2010 to 2019. + This is a second run of the same simulation from 2020-02-01 to check replication. This is a test for an update due to a changed description. +sources: +- ../../../ExperimentalData/2020_climate-model-predict/1980-01-01/temperatures-*.csv +- ../../../ExperimentalData/2020_climate-model-predict/1990-01-01/temperatures-*.csv +- ../../../ExperimentalData/2020_climate-model-predict/2000-01-01/temperatures-*.csv +- ../2020-02-01/ +results: +- file: params.json + description: Model parameters for the best fit to the training set. +- file: predictions-201*.csv + description: Annual temperature predictions with geographical locations +scripts: +- file: model.py + description: python module with the model equations +- file: fit_parameters.py + description: Fit model parameters to training data using a basinhopping optimizer +- file: predict.py + description: Use optimized parameters to simulate average temperatures from 2010 to 2019 +... diff --git a/unittests/test_tool.py b/unittests/test_tool.py index 1988d701465e88b5bd540d4f09c3338aaebe2ccf..b85ecb50b57d97f49315f91fae59c15697184f12 100755 --- a/unittests/test_tool.py +++ b/unittests/test_tool.py @@ -238,7 +238,10 @@ def test_crawler_update_list(crawler, ident): assert len(comp[0]["properties"]) == 0 assert len(comp[1]["properties"]) == 0 - insl, updl = crawler.synchronize() + +@pytest.mark.xfail +def test_synchronization(crawler, ident): + insl, updl = crawler.synchronize(commit_changes=False) assert len(insl) == 0 assert len(updl) == 0