diff options
author | Chocobozzz <me@florianbigard.com> | 2021-07-16 10:42:24 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-07-20 15:27:18 +0200 |
commit | c0e8b12e7fd554ba4d2ceb0c4900804c6a4c63ea (patch) | |
tree | baf29753ac5d4598643e3bee719f8df0cc36c59d /server/tests/api/activitypub | |
parent | 08642a765ea514a00f159db898edf14c376fbe6c (diff) | |
download | PeerTube-c0e8b12e7fd554ba4d2ceb0c4900804c6a4c63ea.tar.gz PeerTube-c0e8b12e7fd554ba4d2ceb0c4900804c6a4c63ea.tar.zst PeerTube-c0e8b12e7fd554ba4d2ceb0c4900804c6a4c63ea.zip |
Refactor requests
Diffstat (limited to 'server/tests/api/activitypub')
-rw-r--r-- | server/tests/api/activitypub/client.ts | 4 | ||||
-rw-r--r-- | server/tests/api/activitypub/refresher.ts | 2 | ||||
-rw-r--r-- | server/tests/api/activitypub/security.ts | 19 |
3 files changed, 9 insertions, 16 deletions
diff --git a/server/tests/api/activitypub/client.ts b/server/tests/api/activitypub/client.ts index 720231f02..53cc40663 100644 --- a/server/tests/api/activitypub/client.ts +++ b/server/tests/api/activitypub/client.ts | |||
@@ -2,7 +2,7 @@ | |||
2 | 2 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import * as chai from 'chai' | 4 | import * as chai from 'chai' |
5 | import { HttpStatusCode } from '@shared/core-utils' | 5 | import { HttpStatusCode } from '@shared/models' |
6 | import { | 6 | import { |
7 | cleanupTests, | 7 | cleanupTests, |
8 | doubleFollow, | 8 | doubleFollow, |
@@ -68,7 +68,7 @@ describe('Test activitypub', function () { | |||
68 | await setDefaultVideoChannel(servers) | 68 | await setDefaultVideoChannel(servers) |
69 | 69 | ||
70 | { | 70 | { |
71 | video = await await servers[0].videos.quickUpload({ name: 'video' }) | 71 | video = await servers[0].videos.quickUpload({ name: 'video' }) |
72 | } | 72 | } |
73 | 73 | ||
74 | { | 74 | { |
diff --git a/server/tests/api/activitypub/refresher.ts b/server/tests/api/activitypub/refresher.ts index bbec0d309..a0b72c7e6 100644 --- a/server/tests/api/activitypub/refresher.ts +++ b/server/tests/api/activitypub/refresher.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import { HttpStatusCode } from '@shared/core-utils' | 4 | import { HttpStatusCode } from '@shared/models' |
5 | import { | 5 | import { |
6 | cleanupTests, | 6 | cleanupTests, |
7 | doubleFollow, | 7 | doubleFollow, |
diff --git a/server/tests/api/activitypub/security.ts b/server/tests/api/activitypub/security.ts index c173648b3..94d946563 100644 --- a/server/tests/api/activitypub/security.ts +++ b/server/tests/api/activitypub/security.ts | |||
@@ -2,20 +2,13 @@ | |||
2 | 2 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import * as chai from 'chai' | 4 | import * as chai from 'chai' |
5 | import { activityPubContextify, buildSignedActivity } from '@server/helpers/activitypub' | ||
5 | import { buildDigest } from '@server/helpers/peertube-crypto' | 6 | import { buildDigest } from '@server/helpers/peertube-crypto' |
6 | import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' | 7 | import { HTTP_SIGNATURE } from '@server/initializers/constants' |
7 | import { | 8 | import { buildGlobalHeaders } from '@server/lib/job-queue/handlers/utils/activitypub-http-utils' |
8 | buildAbsoluteFixturePath, | 9 | import { buildAbsoluteFixturePath, cleanupTests, createMultipleServers, killallServers, PeerTubeServer, wait } from '@shared/extra-utils' |
9 | cleanupTests, | 10 | import { makeFollowRequest, makePOSTAPRequest } from '@shared/extra-utils/requests/activitypub' |
10 | createMultipleServers, | 11 | import { HttpStatusCode } from '@shared/models' |
11 | killallServers, | ||
12 | PeerTubeServer, | ||
13 | wait | ||
14 | } from '../../../../shared/extra-utils' | ||
15 | import { makeFollowRequest, makePOSTAPRequest } from '../../../../shared/extra-utils/requests/activitypub' | ||
16 | import { activityPubContextify, buildSignedActivity } from '../../../helpers/activitypub' | ||
17 | import { HTTP_SIGNATURE } from '../../../initializers/constants' | ||
18 | import { buildGlobalHeaders } from '../../../lib/job-queue/handlers/utils/activitypub-http-utils' | ||
19 | 12 | ||
20 | const expect = chai.expect | 13 | const expect = chai.expect |
21 | 14 | ||