Skip to content

Commit

Permalink
Update the postgresql test after other small changes in paths and API
Browse files Browse the repository at this point in the history
  • Loading branch information
jesper-friis committed Oct 26, 2024
1 parent d906b7d commit 7b11b6d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 1 addition & 2 deletions storages/python/python-storage-plugins/postgresql.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,7 @@ def load(self, uuid):

# The uuid will be wrong for data instances, so override it
if not inst.is_metameta:
d = inst.asdict()
d["uuid"] = uuid
d = inst.asdict(single=True, uuid=True)
inst = instance_from_dict(d)
return inst

Expand Down
2 changes: 1 addition & 1 deletion storages/python/tests-c/test_postgresql_storage.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ MU_TEST(test_save)
double age = 42.;
const char *skills[] = {"jumping", "hopping"};
int n, i;
char *paths = STRINGIFY(dlite_SOURCE_DIR) "/storage/python/tests/*.json";
char *paths = STRINGIFY(dlite_SOURCE_DIR) "/storage/python/tests-c/*.json";
mu_check(dlite_storage_plugin_path_append(paths) >= 0);
mu_check((meta = dlite_instance_load_url("json://Person.json?mode=r")));
Expand Down
4 changes: 4 additions & 0 deletions storages/python/tests-c/test_postgresql_storage2.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ MU_TEST(test_load_meta)
{
DLiteInstance *meta;
char url[256], *id="http://onto-ns.com/meta/0.1/Person";
char *paths = STRINGIFY(dlite_SOURCE_DIR) "/storage/python/tests-c/*.json";
mu_check(dlite_storage_plugin_path_append(paths) >= 0);
snprintf(url, sizeof(url), "postgresql://%s?%s#%s", HOST, options, id);
mu_check((meta = dlite_instance_load_url(url)));
Expand Down

0 comments on commit 7b11b6d

Please sign in to comment.