Skip to content

Commit

Permalink
test: rucio server fixtures type errors
Browse files Browse the repository at this point in the history
  • Loading branch information
maany committed Jul 17, 2023
1 parent 11b5677 commit 413d42a
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions test/fixtures/rucio-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,14 @@ export default class MockRucioServerFactory {
* @param endpoints The endpoints to match against incoming requests.
*/
static createMockRucioServer(checkAuth: boolean = true, endpoints: MockEndpoint[]) {
//disable eslint
// eslint-disable-next-line
fetchMock.mockIf(/^https?:\/\/rucio-host.com.*$/, req => {
if (checkAuth) {
const rucioToken = req.headers.get('X-Rucio-Auth-Token')
if (rucioToken !== MockRucioServerFactory.VALID_RUCIO_TOKEN) {
return Promise.resolve({
status: 401,
body: JSON.stringify({
"ExceptionClass": "CannotAuthenticate",
"ExceptionMessage": "Cannot authenticate with given credentials"
})
})
}
}
Expand Down

0 comments on commit 413d42a

Please sign in to comment.