This repository has been archived by the owner on Aug 25, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
38 additions
and
4 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
16 changes: 16 additions & 0 deletions
16
tests/slo/backup_creation_latency/test_latency_query_specification.py
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,16 @@ | ||
from unittest import TestCase | ||
|
||
from src.slo.backup_creation_latency.latency_query_specification import LatencyQuerySpecification | ||
from src.commons.config.configuration import Configuration | ||
from mock import patch, PropertyMock | ||
|
||
|
||
class TestLatencyQuerySpecification(TestCase): | ||
@patch.object(Configuration, 'projects_to_skip', return_value=['BBQ-project-id', 'ta-testing-project', '123'], | ||
new_callable=PropertyMock) | ||
def test_should_create_valid_query_with_skipped_projects_in_it(self, projects_to_skip): | ||
projects_to_skip.return_value = ['BBQ-project-id', 'ta-testing-project', '123'] | ||
latency_query_spec = LatencyQuerySpecification(3) | ||
query = latency_query_spec.query_string() | ||
self.assertEqual(query, | ||
"SELECT * FROM [BBQ-project-id:SLI_backup_creation_latency_views.SLI_3_days] WHERE projectId NOT IN ('BBQ-project-id', 'ta-testing-project', '123')") |
16 changes: 16 additions & 0 deletions
16
tests/slo/backup_quality/test_quality_query_specification.py
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,16 @@ | ||
from unittest import TestCase | ||
|
||
from src.slo.backup_quality.quality_query_specification import QualityQuerySpecification | ||
from src.commons.config.configuration import Configuration | ||
from mock import patch, PropertyMock | ||
|
||
|
||
class TestQualityQuerySpecification(TestCase): | ||
@patch.object(Configuration, 'projects_to_skip', return_value=['BBQ-project-id', 'ta-testing-project', '123'], | ||
new_callable=PropertyMock) | ||
def test_should_create_valid_query_with_skipped_projects_in_it(self, projects_to_skip): | ||
projects_to_skip.return_value = ['BBQ-project-id', 'ta-testing-project', '123'] | ||
quality_query_spec = QualityQuerySpecification() | ||
query = quality_query_spec.query_string() | ||
self.assertEqual(query, | ||
"SELECT * FROM [BBQ-project-id:SLI_backup_quality_views.SLI_quality] WHERE projectId NOT IN ('BBQ-project-id', 'ta-testing-project', '123')") |