Skip to content

Commit

Permalink
some cleanup, remove get_object_info from upa api - out of scope
Browse files Browse the repository at this point in the history
  • Loading branch information
briehl committed Nov 4, 2017
1 parent e5557ff commit d9dec65
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 195 deletions.
20 changes: 3 additions & 17 deletions kbase-extension/static/kbase/js/api/upaApi.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
define([
'kbase-client-api'
], function(kbaseClientApi) {
], function() {
'use strict';

var UpaApi = function(mainWorkspace, auth) {
var UpaApi = function(mainWorkspace) {
var externalTag = '&',
mainWs = String(mainWorkspace),
wsLen = mainWs.length,
authToken = auth ? auth.token : null;
wsLen = mainWs.length;

/**
* Runs a regex that tests the given string to see if it's a valid upa.
Expand Down Expand Up @@ -62,22 +60,10 @@ define([
return deserial;
};

/**
* @public
* @method
* When complete, will effectively wrap workspace.get_object_info3 to use upas/ headless
* upas. Might be redundant.
* TODO
*/
var getObjectInfo = function(upa) {

return upa;
};

return {
serialize: serialize,
deserialize: deserialize,
getObjectInfo: getObjectInfo,
externalTag: externalTag
};
};
Expand Down
13 changes: 0 additions & 13 deletions nbextensions/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,6 @@ export IPYTHONDIR=$narrdir/kbase-extension/ipython
echo 'Root dir'
echo ${dir}

#jupyter nbextension disable appCell/main --sys-prefix
#jupyter nbextension uninstall ${dir}/appCell --sys-prefix
#jupyter nbextension install ${dir}/appCell --symlink --sys-prefix
#jupyter nbextension enable appCell/main --sys-prefix

#jupyter nbextension disable methodViewCell/main --sys-prefix
#jupyter nbextension uninstall ${dir}/methodViewCell --sys-prefix
jupyter nbextension install ${dir}/viewCell --symlink --sys-prefix
jupyter nbextension enable viewCell/main --sys-prefix

Expand All @@ -38,9 +31,3 @@ jupyter nbextension enable advancedViewCell/main --sys-prefix

jupyter nbextension install ${dir}/codeCell --symlink --sys-prefix
jupyter nbextension enable codeCell/main --sys-prefix

# jupyter nbextension disable codeCell/main --sys-prefix
# jupyter nbextension install ${dir}/codeCell --symlink --sys-prefix

#jupyter nbextension disable customView/main --sys-prefix
#jupyter nbextension uninstall ${dir}/customView --sys-prefix
142 changes: 0 additions & 142 deletions test/unit/spec/api/fileStagingSpec.js

This file was deleted.

27 changes: 4 additions & 23 deletions test/unit/spec/api/upaApiSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,12 @@
/*jslint white: true*/

define ([
'api/upaApi',
'narrativeConfig',
'testUtil'
'api/upaApi'
], function(
UpaApi,
Config,
TestUtil
UpaApi
) {
'use strict';
describe('Test the Workspace object API', function() {
describe('Test the UPA API', function() {

var mainWorkspace = '31',
upaApi,
Expand All @@ -33,22 +29,16 @@ define ([
}];

beforeEach(function() {
if (TestUtil.getAuthToken()) {
upaApi = new UpaApi(mainWorkspace, {token: TestUtil.getAuthToken()});
}
upaApi = new UpaApi(mainWorkspace);
});

it('Should properly serialize an UPA from this workspace', function () {
TestUtil.pendingIfNoToken();

testData.forEach(function(pair) {
expect(upaApi.serialize(pair.upa)).toBe(pair.serial);
});
});

it('Should properly deserialize an UPA from this workspace', function () {
TestUtil.pendingIfNoToken();

testData.forEach(function(pair) {
if (typeof pair.upa === 'string') {
expect(upaApi.deserialize(pair.serial)).toBe(pair.upa);
Expand All @@ -57,25 +47,16 @@ define ([
});

it('Should serialize an UPA from a different workspace', function () {
TestUtil.pendingIfNoToken();

var upa = '1/2/3';
expect(upaApi.serialize(upa)).toBe(upaApi.externalTag + upa);
});

it('Should deserialize an UPA from a different workspace', function() {
TestUtil.pendingIfNoToken();

var upa = '1/2/3';
var externalUpa = upaApi.externalTag + upa;
expect(upaApi.deserialize(externalUpa)).toBe(upa);
});

it('Should retrieve object info from an UPA (headless or not)', function () {
TestUtil.pendingIfNoToken();
// TODO
});

it('Should fail to serialize a bad UPA', function () {
try {
upaApi.serialize('not_an_upa');
Expand Down

0 comments on commit d9dec65

Please sign in to comment.