Skip to content

Commit

Permalink
Merge pull request #116 from saalfeldlab/refactorTests
Browse files Browse the repository at this point in the history
Refactor tests
  • Loading branch information
bogovicj authored Mar 4, 2024
2 parents 4b3dd4e + 003c0ff commit e5deaf9
Show file tree
Hide file tree
Showing 4 changed files with 153 additions and 153 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public N5KeyValueReader(
final boolean cacheMeta)
throws N5Exception {

this(true, keyValueAccess, basePath, gsonBuilder, cacheMeta);
this(true, keyValueAccess, basePath, gsonBuilder, cacheMeta, true);
}

/**
Expand Down Expand Up @@ -116,7 +116,8 @@ protected N5KeyValueReader(
final KeyValueAccess keyValueAccess,
final String basePath,
final GsonBuilder gsonBuilder,
final boolean cacheMeta)
final boolean cacheMeta,
final boolean checkExists)
throws N5Exception {

this.keyValueAccess = keyValueAccess;
Expand All @@ -138,6 +139,9 @@ protected N5KeyValueReader(
throw new N5Exception.N5IOException(
"Incompatible version " + version + " (this is " + VERSION + ").");
}

if (checkExists && !exists("/"))
throw new N5Exception.N5IOException("No container exists at " + basePath);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public N5KeyValueWriter(
final boolean cacheAttributes)
throws N5Exception {

super(false, keyValueAccess, basePath, gsonBuilder, cacheAttributes);
super(false, keyValueAccess, basePath, gsonBuilder, cacheAttributes, false);

Version version = null;
try {
Expand Down
Loading

0 comments on commit e5deaf9

Please sign in to comment.