Skip to content

Commit

Permalink
Updating tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jamiehewitt15 committed Jun 11, 2024
1 parent ec3f03b commit 3bffda2
Showing 1 changed file with 2 additions and 26 deletions.
28 changes: 2 additions & 26 deletions test/publish.test.ts → test/consumeFlow.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,6 @@ describe("Ocean CLI Publishing", function() {
return;
}

process.env.PRIVATE_KEY = "0x1d751ded5a32226054cd2e71261039b65afb9ee1c746d055dd699b1150a5befc";
process.env.RPC = "http://127.0.0.1:8545";
process.env.AQUARIUS_URL = "http://127.0.0.1:8001";
process.env.PROVIDER_URL = "http://127.0.0.1:8001";
process.env.ADDRESS_FILE = path.join(process.env.HOME || "", ".ocean/ocean-contracts/artifacts/address.json");

exec(`npm run cli publish ${metadataFile}`, { cwd: projectRoot }, (error, stdout) => {
try {
const match = stdout.match(/did:op:[a-f0-9]{64}/);
Expand All @@ -80,12 +74,6 @@ describe("Ocean CLI Publishing", function() {
return;
}

process.env.PRIVATE_KEY = "0x1d751ded5a32226054cd2e71261039b65afb9ee1c746d055dd699b1150a5befc";
process.env.RPC = "http://127.0.0.1:8545";
process.env.AQUARIUS_URL = "http://127.0.0.1:8001";
process.env.PROVIDER_URL = "http://127.0.0.1:8001";
process.env.ADDRESS_FILE = path.join(process.env.HOME || "", ".ocean/ocean-contracts/artifacts/address.json");

exec(`npm run cli publishAlgo ${filePath}`, { cwd: projectRoot }, (error, stdout) => {
try {
expect(stdout).to.contain("Algorithm published. DID:");
Expand All @@ -109,12 +97,6 @@ describe("Ocean CLI Publishing", function() {
return;
}

process.env.PRIVATE_KEY = "0x1d751ded5a32226054cd2e71261039b65afb9ee1c746d055dd699b1150a5befc";
process.env.RPC = "http://127.0.0.1:8545";
process.env.AQUARIUS_URL = "http://127.0.0.1:8001";
process.env.PROVIDER_URL = "http://127.0.0.1:8001";
process.env.ADDRESS_FILE = path.join(process.env.HOME || "", ".ocean/ocean-contracts/artifacts/address.json");

exec(`npm run cli publishAlgo ${filePath}`, { cwd: projectRoot }, (error, stdout) => {
try {
expect(stdout).to.contain("Algorithm published. DID:");
Expand All @@ -139,7 +121,7 @@ describe("Ocean CLI Publishing", function() {
});


it("should get DDO using 'npm run cli getDDO' for download dataset", function(done) {
it("should get DDO using 'npm run cli getDDO' for compute dataset", function(done) {
exec(`npm run cli getDDO ${computeDatasetDid}`, { cwd: projectRoot }, (error, stdout) => {
expect(stdout).to.contain(`${computeDatasetDid}`);
expect(stdout).to.contain("[ 'https://w3id.org/did/v1' ]");
Expand All @@ -165,11 +147,5 @@ describe("Ocean CLI Publishing", function() {
done()
});
});

it("should get DDO using 'npm run cli getDDO' for python algorithm", function(done) {
exec(`npm run cli download ${downloadDatasetDid} ./`, { cwd: projectRoot }, (error, stdout) => {
expect(stdout).to.contain("File downloaded successfully");
done()
});
});

});

0 comments on commit 3bffda2

Please sign in to comment.