Пример #1
0
 def test_remove_record(self, rec_id, schema_file_path, config_file_path,
                        results_file_path, backend):
     args = dict(schema_path=schema_file_path, name="test")
     backend_data = {"database_config": config_file_path} if backend == "db"\
         else {"results_file": results_file_path}
     args.update(backend_data)
     psm = PipestatManager(**args)
     psm.remove(record_identifier=rec_id)
     assert rec_id not in psm.data["test"]
Пример #2
0
 def test_remove_nonexistent_record(self, rec_id, schema_file_path,
                                    config_file_path, results_file_path,
                                    backend):
     args = dict(schema_path=schema_file_path, namespace="test")
     backend_data = ({
         "config": config_file_path
     } if backend == "db" else {
         "results_file_path": results_file_path
     })
     args.update(backend_data)
     psm = PipestatManager(**args)
     assert not psm.remove(record_identifier=rec_id)
Пример #3
0
 def test_remove_basic(
     self,
     rec_id,
     res_id,
     val,
     config_file_path,
     results_file_path,
     schema_file_path,
     backend,
 ):
     args = dict(schema_path=schema_file_path,
                 namespace="test",
                 database_only=False)
     backend_data = ({
         "config": config_file_path
     } if backend == "db" else {
         "results_file_path": results_file_path
     })
     args.update(backend_data)
     psm = PipestatManager(**args)
     psm.remove(result_identifier=res_id, record_identifier=rec_id)
     assert res_id not in psm.data["test"][rec_id]
Пример #4
0
 def test_remove(self, val, config_file_path, schema_file_path,
                 results_file_path, backend):
     REC_ID = "constant_record_id"
     args = dict(schema_path=schema_file_path,
                 namespace="test",
                 record_identifier=REC_ID)
     backend_data = ({
         "config": config_file_path
     } if backend == "db" else {
         "results_file_path": results_file_path
     })
     args.update(backend_data)
     psm = PipestatManager(**args)
     assert psm.remove(result_identifier=list(val.keys())[0])