diff options
author | Chocobozzz <me@florianbigard.com> | 2018-12-07 16:09:57 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-12-07 16:25:29 +0100 |
commit | 2a8c5d0af13f3ccb9a505e1fbc9d324b9d33ba1f (patch) | |
tree | 998a0af6923475c85eb8e97ca1d30afb42655263 /server/tests/api/activitypub | |
parent | 4b49385892b25aea5aa9e605fbcb66074bcb49b0 (diff) | |
parent | 35adc403b7eed6d1309bbce901268a76dd01b6ef (diff) | |
download | PeerTube-2a8c5d0af13f3ccb9a505e1fbc9d324b9d33ba1f.tar.gz PeerTube-2a8c5d0af13f3ccb9a505e1fbc9d324b9d33ba1f.tar.zst PeerTube-2a8c5d0af13f3ccb9a505e1fbc9d324b9d33ba1f.zip |
Merge branch 'move-utils-to-shared' of https://github.com/buoyantair/PeerTube into buoyantair-move-utils-to-shared
Diffstat (limited to 'server/tests/api/activitypub')
-rw-r--r-- | server/tests/api/activitypub/client.ts | 6 | ||||
-rw-r--r-- | server/tests/api/activitypub/fetch.ts | 9 | ||||
-rw-r--r-- | server/tests/api/activitypub/helpers.ts | 2 | ||||
-rw-r--r-- | server/tests/api/activitypub/refresher.ts | 17 | ||||
-rw-r--r-- | server/tests/api/activitypub/security.ts | 12 |
5 files changed, 31 insertions, 15 deletions
diff --git a/server/tests/api/activitypub/client.ts b/server/tests/api/activitypub/client.ts index ea0682634..6d90d8643 100644 --- a/server/tests/api/activitypub/client.ts +++ b/server/tests/api/activitypub/client.ts | |||
@@ -8,10 +8,10 @@ import { | |||
8 | flushTests, | 8 | flushTests, |
9 | killallServers, | 9 | killallServers, |
10 | makeActivityPubGetRequest, | 10 | makeActivityPubGetRequest, |
11 | runServer, | ||
12 | ServerInfo, | 11 | ServerInfo, |
13 | setAccessTokensToServers, uploadVideo | 12 | setAccessTokensToServers, |
14 | } from '../../utils' | 13 | uploadVideo |
14 | } from '../../../../shared/utils' | ||
15 | 15 | ||
16 | const expect = chai.expect | 16 | const expect = chai.expect |
17 | 17 | ||
diff --git a/server/tests/api/activitypub/fetch.ts b/server/tests/api/activitypub/fetch.ts index a42c606c6..03609c1a9 100644 --- a/server/tests/api/activitypub/fetch.ts +++ b/server/tests/api/activitypub/fetch.ts | |||
@@ -11,12 +11,13 @@ import { | |||
11 | killallServers, | 11 | killallServers, |
12 | ServerInfo, | 12 | ServerInfo, |
13 | setAccessTokensToServers, | 13 | setAccessTokensToServers, |
14 | setActorField, | ||
15 | setVideoField, | ||
14 | uploadVideo, | 16 | uploadVideo, |
15 | userLogin | 17 | userLogin, |
16 | } from '../../utils' | 18 | waitJobs |
19 | } from '../../../../shared/utils' | ||
17 | import * as chai from 'chai' | 20 | import * as chai from 'chai' |
18 | import { setActorField, setVideoField } from '../../utils/miscs/sql' | ||
19 | import { waitJobs } from '../../utils/server/jobs' | ||
20 | import { Video } from '../../../../shared/models/videos' | 21 | import { Video } from '../../../../shared/models/videos' |
21 | 22 | ||
22 | const expect = chai.expect | 23 | const expect = chai.expect |
diff --git a/server/tests/api/activitypub/helpers.ts b/server/tests/api/activitypub/helpers.ts index 51256a922..ac6e755c3 100644 --- a/server/tests/api/activitypub/helpers.ts +++ b/server/tests/api/activitypub/helpers.ts | |||
@@ -2,7 +2,7 @@ | |||
2 | 2 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import { expect } from 'chai' | 4 | import { expect } from 'chai' |
5 | import { buildRequestStub } from '../../utils' | 5 | import { buildRequestStub } from '../../../../shared/utils/miscs/stubs' |
6 | import { isHTTPSignatureVerified, isJsonLDSignatureVerified, parseHTTPSignature } from '../../../helpers/peertube-crypto' | 6 | import { isHTTPSignatureVerified, isJsonLDSignatureVerified, parseHTTPSignature } from '../../../helpers/peertube-crypto' |
7 | import { cloneDeep } from 'lodash' | 7 | import { cloneDeep } from 'lodash' |
8 | import { buildSignedActivity } from '../../../helpers/activitypub' | 8 | import { buildSignedActivity } from '../../../helpers/activitypub' |
diff --git a/server/tests/api/activitypub/refresher.ts b/server/tests/api/activitypub/refresher.ts index 67e04f79e..332ea7ed1 100644 --- a/server/tests/api/activitypub/refresher.ts +++ b/server/tests/api/activitypub/refresher.ts | |||
@@ -1,10 +1,19 @@ | |||
1 | /* tslint:disable:no-unused-expression */ | 1 | /* tslint:disable:no-unused-expression */ |
2 | 2 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import { doubleFollow, getVideo, reRunServer } from '../../utils' | 4 | import { |
5 | import { flushAndRunMultipleServers, killallServers, ServerInfo, setAccessTokensToServers, uploadVideo, wait } from '../../utils/index' | 5 | doubleFollow, |
6 | import { waitJobs } from '../../utils/server/jobs' | 6 | flushAndRunMultipleServers, |
7 | import { setVideoField } from '../../utils/miscs/sql' | 7 | getVideo, |
8 | killallServers, | ||
9 | reRunServer, | ||
10 | ServerInfo, | ||
11 | setAccessTokensToServers, | ||
12 | uploadVideo, | ||
13 | wait, | ||
14 | setVideoField, | ||
15 | waitJobs | ||
16 | } from '../../../../shared/utils' | ||
8 | 17 | ||
9 | describe('Test AP refresher', function () { | 18 | describe('Test AP refresher', function () { |
10 | let servers: ServerInfo[] = [] | 19 | let servers: ServerInfo[] = [] |
diff --git a/server/tests/api/activitypub/security.ts b/server/tests/api/activitypub/security.ts index 7349749f1..342ae0fa1 100644 --- a/server/tests/api/activitypub/security.ts +++ b/server/tests/api/activitypub/security.ts | |||
@@ -2,13 +2,19 @@ | |||
2 | 2 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | 4 | ||
5 | import { flushAndRunMultipleServers, flushTests, killallServers, ServerInfo } from '../../utils' | 5 | import { |
6 | flushAndRunMultipleServers, | ||
7 | flushTests, | ||
8 | killallServers, | ||
9 | makeFollowRequest, | ||
10 | makePOSTAPRequest, | ||
11 | ServerInfo, | ||
12 | setActorField | ||
13 | } from '../../../../shared/utils' | ||
6 | import { HTTP_SIGNATURE } from '../../../initializers' | 14 | import { HTTP_SIGNATURE } from '../../../initializers' |
7 | import { buildDigest, buildGlobalHeaders } from '../../../lib/job-queue/handlers/utils/activitypub-http-utils' | 15 | import { buildDigest, buildGlobalHeaders } from '../../../lib/job-queue/handlers/utils/activitypub-http-utils' |
8 | import * as chai from 'chai' | 16 | import * as chai from 'chai' |
9 | import { setActorField } from '../../utils/miscs/sql' | ||
10 | import { activityPubContextify, buildSignedActivity } from '../../../helpers/activitypub' | 17 | import { activityPubContextify, buildSignedActivity } from '../../../helpers/activitypub' |
11 | import { makeFollowRequest, makePOSTAPRequest } from '../../utils/requests/activitypub' | ||
12 | 18 | ||
13 | const expect = chai.expect | 19 | const expect = chai.expect |
14 | 20 | ||