Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Jorrit Poelen committed Jul 17, 2023
1 parent 5e3a84e commit a17ad18
Showing 1 changed file with 0 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,29 +1,15 @@
package bio.guoda.preston.store;

import bio.guoda.preston.RefNodeFactory;
import org.hamcrest.core.Is;
import org.junit.Test;

import java.net.URI;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import static junit.framework.TestCase.assertTrue;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.assertEquals;

public class KeyTo1LevelOCIPathTest {

@Test
public void pull() {
//curl -fL --header "Authorization: Bearer QQ==" "https://ghcr.io/v2/cboettig/content-store/blobs/sha256:9412325831dab22aeebdd674b6eb53ba6b7bdd04bb99a4dbb21ddff646287e37" -o test.txt

KeyToPath key2path = new KeyTo1LevelOCIPath(URI.create("bla:foo"));

URI uri = key2path.toPath(RefNodeFactory.toIRI("hash://sha256/b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9"));
assertThat(uri.toString(), Is.is("https://ghcr.io/v2/cboettig/content-store/blobs/sha256:b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9"));
}

@Test
public void ghcrRemotePattern() {

Expand Down

0 comments on commit a17ad18

Please sign in to comment.