-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CM-38374 - Disable Sentry for on-premise installations; fix CLI confi…
…g loading (#239)
- Loading branch information
Showing
6 changed files
with
71 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from typing import TYPE_CHECKING | ||
|
||
from cycode.cli.consts import DEFAULT_CYCODE_DOMAIN | ||
from cycode.cyclient.config import _is_on_premise_installation | ||
|
||
if TYPE_CHECKING: | ||
from _pytest.monkeypatch import MonkeyPatch | ||
|
||
|
||
def test_is_on_premise_installation(monkeypatch: 'MonkeyPatch') -> None: | ||
monkeypatch.setattr('cycode.cyclient.config.cycode_api_url', 'api.cycode.com') | ||
assert not _is_on_premise_installation(DEFAULT_CYCODE_DOMAIN) | ||
monkeypatch.setattr('cycode.cyclient.config.cycode_api_url', 'api.eu.cycode.com') | ||
assert not _is_on_premise_installation(DEFAULT_CYCODE_DOMAIN) | ||
|
||
monkeypatch.setattr('cycode.cyclient.config.cycode_api_url', 'cycode.google.com') | ||
assert _is_on_premise_installation(DEFAULT_CYCODE_DOMAIN) | ||
monkeypatch.setattr('cycode.cyclient.config.cycode_api_url', 'cycode.blabla.google.com') | ||
assert _is_on_premise_installation(DEFAULT_CYCODE_DOMAIN) | ||
|
||
monkeypatch.setattr('cycode.cyclient.config.cycode_api_url', 'api.cycode.com') | ||
assert _is_on_premise_installation('blabla') | ||
monkeypatch.setattr('cycode.cyclient.config.cycode_api_url', 'cycode.blabla.google.com') | ||
assert _is_on_premise_installation('blabla') |