1
0
Fork 0
mirror of synced 2024-10-02 10:16:27 +13:00

Fix console tests

This commit is contained in:
Jake Barnby 2023-08-22 21:35:00 -04:00
parent a84e669a1f
commit 43ba14fb75
No known key found for this signature in database
GPG key ID: C437A8CC85B96E9C
3 changed files with 9 additions and 5 deletions

@ -1 +1 @@
Subproject commit 9865be05f85a36904c308577c53cabc0a8d3120a
Subproject commit 2965a7d661f186a3631794969463717f46159945

View file

@ -30,7 +30,11 @@ App::get('/v1/console/variables')
->inject('response')
->action(function (Response $response) {
$isVcsEnabled = !empty(App::getEnv('_APP_VCS_GITHUB_APP_NAME', '')) && !empty(App::getEnv('_APP_VCS_GITHUB_PRIVATE_KEY', '')) && !empty(App::getEnv('_APP_VCS_GITHUB_APP_ID', '')) && !empty(App::getEnv('_APP_VCS_GITHUB_CLIENT_ID', '')) && !empty(App::getEnv('_APP_VCS_GITHUB_CLIENT_SECRET', ''));
$isVcsEnabled = !empty(App::getEnv('_APP_VCS_GITHUB_APP_NAME', ''))
&& !empty(App::getEnv('_APP_VCS_GITHUB_PRIVATE_KEY', ''))
&& !empty(App::getEnv('_APP_VCS_GITHUB_APP_ID', ''))
&& !empty(App::getEnv('_APP_VCS_GITHUB_CLIENT_ID', ''))
&& !empty(App::getEnv('_APP_VCS_GITHUB_CLIENT_SECRET', ''));
$isAssistantEnabled = !empty(App::getEnv('_APP_ASSISTANT_OPENAI_API_KEY', ''));

View file

@ -21,7 +21,7 @@ class ConsoleConsoleClientTest extends Scope
$response = $this->client->call(Client::METHOD_GET, '/console/variables', array_merge([
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
], $this->getHeaders()), []);
], $this->getHeaders()));
$this->assertEquals(200, $response['headers']['status-code']);
$this->assertCount(6, $response['body']);
@ -29,7 +29,7 @@ class ConsoleConsoleClientTest extends Scope
$this->assertIsInt($response['body']['_APP_STORAGE_LIMIT']);
$this->assertIsInt($response['body']['_APP_FUNCTIONS_SIZE_LIMIT']);
$this->assertIsString($response['body']['_APP_DOMAIN_TARGET']);
$this->assertIsString($response['body']['_APP_VCS_ENABLED']);
$this->assertIsString($response['body']['_APP_ASSISTANT_ENABLED']);
$this->assertIsBool($response['body']['_APP_VCS_ENABLED']);
$this->assertIsBool($response['body']['_APP_ASSISTANT_ENABLED']);
}
}