Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Open Subsurface Data Universe Software
Platform
Domain Data Mgmt Services
Seismic
Seismic DMS Suite
seismic-dms-service
Commits
6617a03a
Commit
6617a03a
authored
Jun 17, 2021
by
Diego Molteni
Browse files
fixed unit tests
parent
9028e977
Pipeline
#46752
passed with stages
in 11 minutes and 15 seconds
Changes
3
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
tests/utest/dataecosystem/compliance.ts
View file @
6617a03a
...
...
@@ -18,6 +18,7 @@ import request from 'request-promise';
import
sinon
from
'
sinon
'
;
import
{
Config
}
from
'
../../../src/cloud
'
;
import
{
google
}
from
'
../../../src/cloud/providers
'
;
import
{
ConfigGoogle
}
from
'
../../../src/cloud/providers/google
'
;
import
{
DESCompliance
}
from
'
../../../src/dataecosystem/compliance
'
;
import
{
RecordLatency
}
from
'
../../../src/metrics/metrics
'
;
import
{
Cache
}
from
'
../../../src/shared
'
;
...
...
@@ -30,6 +31,8 @@ export class TestCompliance {
describe
(
Tx
.
testInit
(
'
dataecosystem compliance
'
),
()
=>
{
ConfigGoogle
.
DATA_PARTITION_REST_HEADER_KEY
=
'
data-partition-id
'
beforeEach
(()
=>
{
this
.
sandbox
=
sinon
.
createSandbox
();
this
.
sandbox
.
stub
(
RecordLatency
.
prototype
,
'
record
'
).
resolves
();
...
...
@@ -50,7 +53,7 @@ export class TestCompliance {
'
AppKey
'
:
'
appkey
'
,
'
Authorization
'
:
'
Bearer usertoken
'
,
'
Content-Type
'
:
'
application/json
'
,
'
slb-
data-partition-id
'
:
'
tenant-a
'
,
'
data-partition-id
'
:
'
tenant-a
'
,
},
json
:
{
names
:
[
'
ltag
'
]
},
url
:
Config
.
DES_SERVICE_HOST_COMPLIANCE
+
'
/legal/v1/legaltags:validate
'
,
...
...
tests/utest/dataecosystem/entitlement.ts
View file @
6617a03a
...
...
@@ -18,6 +18,7 @@ import request from 'request-promise';
import
sinon
from
'
sinon
'
;
import
{
Config
}
from
'
../../../src/cloud
'
;
import
{
google
}
from
'
../../../src/cloud/providers
'
;
import
{
ConfigGoogle
}
from
'
../../../src/cloud/providers/google
'
;
import
{
DESEntitlement
}
from
'
../../../src/dataecosystem
'
;
import
{
RecordLatency
}
from
'
../../../src/metrics/metrics
'
;
import
{
Error
}
from
'
../../../src/shared/error
'
;
...
...
@@ -30,6 +31,9 @@ export class TestDESEntitlement {
describe
(
Tx
.
testInit
(
'
dataecosystem entitlements
'
),
()
=>
{
ConfigGoogle
.
ENTITLEMENT_BASE_URL_PATH
=
'
/entitlements
'
ConfigGoogle
.
DATA_PARTITION_REST_HEADER_KEY
=
'
data-partition-id
'
beforeEach
(()
=>
{
this
.
sandbox
=
sinon
.
createSandbox
();
this
.
sandbox
.
stub
(
RecordLatency
.
prototype
,
'
record
'
).
resolves
();
...
...
@@ -67,9 +71,9 @@ export class TestDESEntitlement {
'
AppKey
'
:
'
appkey
'
,
'
Authorization
'
:
'
Bearer usertoken
'
,
'
Content-Type
'
:
'
application/json
'
,
'
slb-
data-partition-id
'
:
'
tenant-one
'
,
'
data-partition-id
'
:
'
tenant-one
'
,
},
url
:
Config
.
DES_SERVICE_HOST_ENTITLEMENT
+
'
/entitlements
/v2
/groups
'
,
url
:
Config
.
DES_SERVICE_HOST_ENTITLEMENT
+
'
/entitlements
'
+
'
/groups
'
,
};
Tx
.
checkTrue
(
requestStub
.
calledWith
(
options
),
done
);
});
...
...
@@ -101,13 +105,13 @@ export class TestDESEntitlement {
'
AppKey
'
:
'
appkey
'
,
'
Authorization
'
:
'
Bearer usertoken
'
,
'
Content-Type
'
:
'
application/json
'
,
'
slb-
data-partition-id
'
:
'
tenant-a
'
,
'
data-partition-id
'
:
'
tenant-a
'
,
},
json
:
{
email
:
'
user@email
'
,
role
:
'
role-a
'
,
},
url
:
Config
.
DES_SERVICE_HOST_ENTITLEMENT
+
'
/entitlements
/v2
/groups
/
'
+
'
group-a
'
+
'
/members
'
,
url
:
Config
.
DES_SERVICE_HOST_ENTITLEMENT
+
'
/entitlements
'
+
'
/groups
'
+
'
/
group-a
'
+
'
/members
'
,
};
Tx
.
checkTrue
(
requestStub
.
calledWith
(
options
),
done
);
...
...
@@ -139,9 +143,9 @@ export class TestDESEntitlement {
'
AppKey
'
:
'
appkey
'
,
'
Authorization
'
:
'
Bearer usertoken
'
,
'
Content-Type
'
:
'
application/json
'
,
'
slb-
data-partition-id
'
:
'
tenant-a
'
,
'
data-partition-id
'
:
'
tenant-a
'
,
},
url
:
Config
.
DES_SERVICE_HOST_ENTITLEMENT
+
'
/entitlements/
v2/
groups/
'
+
'
group-a
'
+
'
/members/
'
+
'
user@email
'
,
url
:
Config
.
DES_SERVICE_HOST_ENTITLEMENT
+
'
/entitlements/groups/
'
+
'
group-a
'
+
'
/members/
'
+
'
user@email
'
,
};
Tx
.
checkTrue
(
requestStub
.
calledWith
(
options
),
done
);
...
...
@@ -172,13 +176,13 @@ export class TestDESEntitlement {
'
AppKey
'
:
'
appkey
'
,
'
Authorization
'
:
'
Bearer usertoken
'
,
'
Content-Type
'
:
'
application/json
'
,
'
slb-
data-partition-id
'
:
'
tenant-a
'
,
'
data-partition-id
'
:
'
tenant-a
'
,
},
json
:
{
description
:
'
group desc
'
,
name
:
'
group-a
'
,
},
url
:
Config
.
DES_SERVICE_HOST_ENTITLEMENT
+
'
/entitlements/
v2/
groups
'
,
url
:
Config
.
DES_SERVICE_HOST_ENTITLEMENT
+
'
/entitlements/groups
'
,
};
Tx
.
checkTrue
(
requestStub
.
calledWith
(
options
),
done
);
...
...
tests/utest/dataecosystem/storage.ts
View file @
6617a03a
...
...
@@ -18,6 +18,7 @@ import request from 'request-promise';
import
sinon
from
'
sinon
'
;
import
{
Config
}
from
'
../../../src/cloud
'
;
import
{
google
}
from
'
../../../src/cloud/providers
'
;
import
{
ConfigGoogle
}
from
'
../../../src/cloud/providers/google
'
;
import
{
DESStorage
,
DESUtils
}
from
'
../../../src/dataecosystem
'
;
import
{
RecordLatency
}
from
'
../../../src/metrics/metrics
'
;
import
{
Tx
}
from
'
../utils
'
;
...
...
@@ -28,6 +29,8 @@ export class TestStorage {
describe
(
Tx
.
testInit
(
'
dataecosystem storage service
'
),
()
=>
{
ConfigGoogle
.
DATA_PARTITION_REST_HEADER_KEY
=
'
data-partition-id
'
beforeEach
(()
=>
{
this
.
sandbox
=
sinon
.
createSandbox
();
this
.
sandbox
.
stub
(
RecordLatency
.
prototype
,
'
record
'
).
resolves
();
...
...
@@ -71,7 +74,7 @@ export class TestStorage {
'
AppKey
'
:
'
appkey
'
,
'
Authorization
'
:
'
Bearer usertoken
'
,
'
Content-Type
'
:
'
application/json
'
,
'
slb-
data-partition-id
'
:
'
tenant-a
'
,
'
data-partition-id
'
:
'
tenant-a
'
,
},
json
:
JSON
.
stringify
({
seismetadata
:
'
data
'
}),
url
:
Config
.
DES_SERVICE_HOST_STORAGE
+
'
/storage/v2/records
'
,
...
...
@@ -126,7 +129,7 @@ export class TestStorage {
'
AppKey
'
:
'
appkey
'
,
'
Authorization
'
:
'
Bearer usertoken
'
,
'
Content-Type
'
:
'
application/json
'
,
'
slb-
data-partition-id
'
:
'
tenant-a
'
,
'
data-partition-id
'
:
'
tenant-a
'
,
},
url
:
Config
.
DES_SERVICE_HOST_STORAGE
+
'
/storage/v2/records/uid
'
+
'
:delete
'
,
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment