From eb1b6933af2321f30b6ecab70bb1ba638f7dfbdc Mon Sep 17 00:00:00 2001 From: "Michael Bradley, Jr" Date: Tue, 5 Mar 2019 10:50:25 -0600 Subject: [PATCH] fix: revise test urls to reflect test_dapps/ -> dapps/tests/ --- .../app/app/contracts/SimpleStorageWithHttpImport.sol | 5 ++--- dapps/tests/app/test/http_contract_test.js | 2 +- packages/embark/src/test/config.js | 8 ++++---- .../src/test/contracts/contract_with_http_import.sol | 5 +++-- packages/embark/src/test/file.js | 2 +- packages/embark/src/test/utils.js | 8 ++++---- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/dapps/tests/app/app/contracts/SimpleStorageWithHttpImport.sol b/dapps/tests/app/app/contracts/SimpleStorageWithHttpImport.sol index 91ec86e3d..0a9aef1b5 100644 --- a/dapps/tests/app/app/contracts/SimpleStorageWithHttpImport.sol +++ b/dapps/tests/app/app/contracts/SimpleStorageWithHttpImport.sol @@ -1,8 +1,7 @@ pragma solidity ^0.4.17; -import "https://github.com/embark-framework/embark/blob/master/test_dapps/contracts_app/contracts/ownable.sol"; -import "https://github.com/embark-framework/embark/blob/master/test_dapps/contracts_app/contracts/contract_args.sol"; - +import "https://github.com/embark-framework/embark/blob/master/dapps/tests/contracts/contracts/ownable.sol"; +import "https://github.com/embark-framework/embark/blob/master/dapps/tests/contracts/contracts/contract_args.sol"; contract SimpleStorageWithHttpImport is Ownable { uint public storedData; diff --git a/dapps/tests/app/test/http_contract_test.js b/dapps/tests/app/test/http_contract_test.js index 2f9ce43ce..1f4a70dff 100644 --- a/dapps/tests/app/test/http_contract_test.js +++ b/dapps/tests/app/test/http_contract_test.js @@ -24,7 +24,7 @@ describe('http contracts', () => { }); it('should have downloaded the http import in SimpleStorageWithHttpImport', (done) => { - const contractImportPath = '.embark/contracts/embark-framework/embark/master/test_dapps/contracts_app/contracts/ownable.sol'; + const contractImportPath = '.embark/contracts/embark-framework/embark/master/dapps/tests/contracts/contracts/ownable.sol'; fs.access(contractImportPath, (err) => { if (err) { assert.fail(contractImportPath + ' was not downloaded'); diff --git a/packages/embark/src/test/config.js b/packages/embark/src/test/config.js index 81a74d327..716c57c1b 100644 --- a/packages/embark/src/test/config.js +++ b/packages/embark/src/test/config.js @@ -179,7 +179,7 @@ describe('embark.Config', function () { config.contractsFiles = []; config.contractsConfig.contracts = [ { - file: 'https://github.com/embark-framework/embark/master/test_dapps/test_app/app/contracts/simple_storage.sol' + file: 'https://github.com/embark-framework/embark/blob/master/dapps/templates/demo/contracts/simple_storage.sol' }, { file: 'github.com/status-im/contracts/contracts/identity/ERC725.sol' @@ -191,9 +191,9 @@ describe('embark.Config', function () { const expected = [ { "type": "http", - "externalUrl": "https://raw.githubusercontent.com/embark-framework/embark/master/test_dapps/test_app/app/contracts/simple_storage.sol", - "path": fs.dappPath(".embark/contracts/embark-framework/embark/master/test_dapps/test_app/app/contracts/simple_storage.sol"), - "originalPath": ".embark/contracts/embark-framework/embark/master/test_dapps/test_app/app/contracts/simple_storage.sol", + "externalUrl": "https://raw.githubusercontent.com/embark-framework/embark/master/dapps/templates/demo/contracts/simple_storage.sol", + "path": fs.dappPath(".embark/contracts/embark-framework/embark/master/dapps/templates/demo/contracts/simple_storage.sol"), + "originalPath": ".embark/contracts/embark-framework/embark/master/dapps/templates/demo/contracts/simple_storage.sol", "pluginPath": '', "basedir": "", "importRemappings": [], diff --git a/packages/embark/src/test/contracts/contract_with_http_import.sol b/packages/embark/src/test/contracts/contract_with_http_import.sol index 10f50b49f..f7f7ad06d 100644 --- a/packages/embark/src/test/contracts/contract_with_http_import.sol +++ b/packages/embark/src/test/contracts/contract_with_http_import.sol @@ -1,5 +1,7 @@ pragma solidity ^0.5.0; -import "https://github.com/embark-framework/embark/blob/master/test_dapps/test_apps/contracts_app/contracts/contract_args.sol"; + +import "https://github.com/embark-framework/embark/blob/master/dapps/tests/contracts/contracts/contract_args.sol"; + contract SimpleStorage { uint public storedData; @@ -16,4 +18,3 @@ contract SimpleStorage { } } - diff --git a/packages/embark/src/test/file.js b/packages/embark/src/test/file.js index 0dad6ec02..6e49e440e 100644 --- a/packages/embark/src/test/file.js +++ b/packages/embark/src/test/file.js @@ -6,7 +6,7 @@ const fs = require("../lib/core/fs"); describe('embark.File', function () { describe('Read file contents', function () { it('should be able to download a file when type is "http"', async () => { - const file = new File({externalUrl: 'https://raw.githubusercontent.com/embark-framework/embark/master/test_dapps/test_app/app/contracts/simple_storage.sol', type: Types.http}); + const file = new File({externalUrl: 'https://raw.githubusercontent.com/embark-framework/embark/master/dapps/tests/app/app/contracts/simple_storage.sol', type: Types.http}); const content = await file.content; expect(content).to.be.ok; //eslint-disable-line diff --git a/packages/embark/src/test/utils.js b/packages/embark/src/test/utils.js index 72420571e..bb9d438a2 100644 --- a/packages/embark/src/test/utils.js +++ b/packages/embark/src/test/utils.js @@ -7,18 +7,18 @@ describe('embark.utils', function () { describe('#getExternalContractUrl', function () { it('should get the right url for a https://github file', function () { const fileObj = Utils.getExternalContractUrl( - 'https://github.com/embark-framework/embark/blob/master/test_dapps/test_app/app/contracts/simple_storage.sol' + 'https://github.com/embark-framework/embark/blob/master/dapps/templates/demo/contracts/simple_storage.sol' ); assert.deepEqual(fileObj, { - filePath: constants.httpContractsDirectory + 'embark-framework/embark/master/test_dapps/test_app/app/contracts/simple_storage.sol', - url: 'https://raw.githubusercontent.com/embark-framework/embark/master/test_dapps/test_app/app/contracts/simple_storage.sol' + filePath: constants.httpContractsDirectory + 'embark-framework/embark/master/dapps/templates/demo/contracts/simple_storage.sol', + url: 'https://raw.githubusercontent.com/embark-framework/embark/master/dapps/templates/demo/contracts/simple_storage.sol' }); }); it('should fail for a malformed https://github file', function () { const fileObj = Utils.getExternalContractUrl( - 'https://github/embark-framework/embark/blob/master/test_dapps/test_app/app/contracts/simple_storage.sol' + 'https://github/embark-framework/embark/blob/master/dapps/templates/demo/contracts/simple_storage.sol' ); assert.strictEqual(fileObj, null); });