diff options
author | Chocobozzz <me@florianbigard.com> | 2021-07-16 09:04:35 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-07-20 15:27:18 +0200 |
commit | 89d241a79c262b9775c233b73cff080043ebb5e6 (patch) | |
tree | cb3b6cb431d25d891ef4e02f66c61d252d17048f /server/tests/api/activitypub/refresher.ts | |
parent | d23dd9fbfc4d26026352c10f81d2795ceaf2908a (diff) | |
download | PeerTube-89d241a79c262b9775c233b73cff080043ebb5e6.tar.gz PeerTube-89d241a79c262b9775c233b73cff080043ebb5e6.tar.zst PeerTube-89d241a79c262b9775c233b73cff080043ebb5e6.zip |
Shorter server command names
Diffstat (limited to 'server/tests/api/activitypub/refresher.ts')
-rw-r--r-- | server/tests/api/activitypub/refresher.ts | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/server/tests/api/activitypub/refresher.ts b/server/tests/api/activitypub/refresher.ts index 5af4b1edb..d2f71e857 100644 --- a/server/tests/api/activitypub/refresher.ts +++ b/server/tests/api/activitypub/refresher.ts | |||
@@ -34,28 +34,28 @@ describe('Test AP refresher', function () { | |||
34 | await setDefaultVideoChannel(servers) | 34 | await setDefaultVideoChannel(servers) |
35 | 35 | ||
36 | { | 36 | { |
37 | videoUUID1 = (await servers[1].videosCommand.quickUpload({ name: 'video1' })).uuid | 37 | videoUUID1 = (await servers[1].videos.quickUpload({ name: 'video1' })).uuid |
38 | videoUUID2 = (await servers[1].videosCommand.quickUpload({ name: 'video2' })).uuid | 38 | videoUUID2 = (await servers[1].videos.quickUpload({ name: 'video2' })).uuid |
39 | videoUUID3 = (await servers[1].videosCommand.quickUpload({ name: 'video3' })).uuid | 39 | videoUUID3 = (await servers[1].videos.quickUpload({ name: 'video3' })).uuid |
40 | } | 40 | } |
41 | 41 | ||
42 | { | 42 | { |
43 | const token1 = await servers[1].usersCommand.generateUserAndToken('user1') | 43 | const token1 = await servers[1].users.generateUserAndToken('user1') |
44 | await servers[1].videosCommand.upload({ token: token1, attributes: { name: 'video4' } }) | 44 | await servers[1].videos.upload({ token: token1, attributes: { name: 'video4' } }) |
45 | 45 | ||
46 | const token2 = await servers[1].usersCommand.generateUserAndToken('user2') | 46 | const token2 = await servers[1].users.generateUserAndToken('user2') |
47 | await servers[1].videosCommand.upload({ token: token2, attributes: { name: 'video5' } }) | 47 | await servers[1].videos.upload({ token: token2, attributes: { name: 'video5' } }) |
48 | } | 48 | } |
49 | 49 | ||
50 | { | 50 | { |
51 | const attributes = { displayName: 'playlist1', privacy: VideoPlaylistPrivacy.PUBLIC, videoChannelId: servers[1].videoChannel.id } | 51 | const attributes = { displayName: 'playlist1', privacy: VideoPlaylistPrivacy.PUBLIC, videoChannelId: servers[1].store.channel.id } |
52 | const created = await servers[1].playlistsCommand.create({ attributes }) | 52 | const created = await servers[1].playlists.create({ attributes }) |
53 | playlistUUID1 = created.uuid | 53 | playlistUUID1 = created.uuid |
54 | } | 54 | } |
55 | 55 | ||
56 | { | 56 | { |
57 | const attributes = { displayName: 'playlist2', privacy: VideoPlaylistPrivacy.PUBLIC, videoChannelId: servers[1].videoChannel.id } | 57 | const attributes = { displayName: 'playlist2', privacy: VideoPlaylistPrivacy.PUBLIC, videoChannelId: servers[1].store.channel.id } |
58 | const created = await servers[1].playlistsCommand.create({ attributes }) | 58 | const created = await servers[1].playlists.create({ attributes }) |
59 | playlistUUID2 = created.uuid | 59 | playlistUUID2 = created.uuid |
60 | } | 60 | } |
61 | 61 | ||
@@ -70,15 +70,15 @@ describe('Test AP refresher', function () { | |||
70 | await wait(10000) | 70 | await wait(10000) |
71 | 71 | ||
72 | // Change UUID so the remote server returns a 404 | 72 | // Change UUID so the remote server returns a 404 |
73 | await servers[1].sqlCommand.setVideoField(videoUUID1, 'uuid', '304afe4f-39f9-4d49-8ed7-ac57b86b174f') | 73 | await servers[1].sql.setVideoField(videoUUID1, 'uuid', '304afe4f-39f9-4d49-8ed7-ac57b86b174f') |
74 | 74 | ||
75 | await servers[0].videosCommand.get({ id: videoUUID1 }) | 75 | await servers[0].videos.get({ id: videoUUID1 }) |
76 | await servers[0].videosCommand.get({ id: videoUUID2 }) | 76 | await servers[0].videos.get({ id: videoUUID2 }) |
77 | 77 | ||
78 | await waitJobs(servers) | 78 | await waitJobs(servers) |
79 | 79 | ||
80 | await servers[0].videosCommand.get({ id: videoUUID1, expectedStatus: HttpStatusCode.NOT_FOUND_404 }) | 80 | await servers[0].videos.get({ id: videoUUID1, expectedStatus: HttpStatusCode.NOT_FOUND_404 }) |
81 | await servers[0].videosCommand.get({ id: videoUUID2 }) | 81 | await servers[0].videos.get({ id: videoUUID2 }) |
82 | }) | 82 | }) |
83 | 83 | ||
84 | it('Should not update a remote video if the remote instance is down', async function () { | 84 | it('Should not update a remote video if the remote instance is down', async function () { |
@@ -86,18 +86,18 @@ describe('Test AP refresher', function () { | |||
86 | 86 | ||
87 | await killallServers([ servers[1] ]) | 87 | await killallServers([ servers[1] ]) |
88 | 88 | ||
89 | await servers[1].sqlCommand.setVideoField(videoUUID3, 'uuid', '304afe4f-39f9-4d49-8ed7-ac57b86b174e') | 89 | await servers[1].sql.setVideoField(videoUUID3, 'uuid', '304afe4f-39f9-4d49-8ed7-ac57b86b174e') |
90 | 90 | ||
91 | // Video will need a refresh | 91 | // Video will need a refresh |
92 | await wait(10000) | 92 | await wait(10000) |
93 | 93 | ||
94 | await servers[0].videosCommand.get({ id: videoUUID3 }) | 94 | await servers[0].videos.get({ id: videoUUID3 }) |
95 | // The refresh should fail | 95 | // The refresh should fail |
96 | await waitJobs([ servers[0] ]) | 96 | await waitJobs([ servers[0] ]) |
97 | 97 | ||
98 | await reRunServer(servers[1]) | 98 | await reRunServer(servers[1]) |
99 | 99 | ||
100 | await servers[0].videosCommand.get({ id: videoUUID3 }) | 100 | await servers[0].videos.get({ id: videoUUID3 }) |
101 | }) | 101 | }) |
102 | }) | 102 | }) |
103 | 103 | ||
@@ -106,13 +106,13 @@ describe('Test AP refresher', function () { | |||
106 | it('Should remove a deleted actor', async function () { | 106 | it('Should remove a deleted actor', async function () { |
107 | this.timeout(60000) | 107 | this.timeout(60000) |
108 | 108 | ||
109 | const command = servers[0].accountsCommand | 109 | const command = servers[0].accounts |
110 | 110 | ||
111 | await wait(10000) | 111 | await wait(10000) |
112 | 112 | ||
113 | // Change actor name so the remote server returns a 404 | 113 | // Change actor name so the remote server returns a 404 |
114 | const to = 'http://localhost:' + servers[1].port + '/accounts/user2' | 114 | const to = 'http://localhost:' + servers[1].port + '/accounts/user2' |
115 | await servers[1].sqlCommand.setActorField(to, 'preferredUsername', 'toto') | 115 | await servers[1].sql.setActorField(to, 'preferredUsername', 'toto') |
116 | 116 | ||
117 | await command.get({ accountName: 'user1@localhost:' + servers[1].port }) | 117 | await command.get({ accountName: 'user1@localhost:' + servers[1].port }) |
118 | await command.get({ accountName: 'user2@localhost:' + servers[1].port }) | 118 | await command.get({ accountName: 'user2@localhost:' + servers[1].port }) |
@@ -132,15 +132,15 @@ describe('Test AP refresher', function () { | |||
132 | await wait(10000) | 132 | await wait(10000) |
133 | 133 | ||
134 | // Change UUID so the remote server returns a 404 | 134 | // Change UUID so the remote server returns a 404 |
135 | await servers[1].sqlCommand.setPlaylistField(playlistUUID2, 'uuid', '304afe4f-39f9-4d49-8ed7-ac57b86b178e') | 135 | await servers[1].sql.setPlaylistField(playlistUUID2, 'uuid', '304afe4f-39f9-4d49-8ed7-ac57b86b178e') |
136 | 136 | ||
137 | await servers[0].playlistsCommand.get({ playlistId: playlistUUID1 }) | 137 | await servers[0].playlists.get({ playlistId: playlistUUID1 }) |
138 | await servers[0].playlistsCommand.get({ playlistId: playlistUUID2 }) | 138 | await servers[0].playlists.get({ playlistId: playlistUUID2 }) |
139 | 139 | ||
140 | await waitJobs(servers) | 140 | await waitJobs(servers) |
141 | 141 | ||
142 | await servers[0].playlistsCommand.get({ playlistId: playlistUUID1, expectedStatus: HttpStatusCode.OK_200 }) | 142 | await servers[0].playlists.get({ playlistId: playlistUUID1, expectedStatus: HttpStatusCode.OK_200 }) |
143 | await servers[0].playlistsCommand.get({ playlistId: playlistUUID2, expectedStatus: HttpStatusCode.NOT_FOUND_404 }) | 143 | await servers[0].playlists.get({ playlistId: playlistUUID2, expectedStatus: HttpStatusCode.NOT_FOUND_404 }) |
144 | }) | 144 | }) |
145 | }) | 145 | }) |
146 | 146 | ||