aboutsummaryrefslogtreecommitdiffhomepage
path: root/infra/build/functions/project_sync_test.py
diff options
context:
space:
mode:
Diffstat (limited to 'infra/build/functions/project_sync_test.py')
-rw-r--r--infra/build/functions/project_sync_test.py28
1 files changed, 26 insertions, 2 deletions
diff --git a/infra/build/functions/project_sync_test.py b/infra/build/functions/project_sync_test.py
index 416029d1..4d7214f4 100644
--- a/infra/build/functions/project_sync_test.py
+++ b/infra/build/functions/project_sync_test.py
@@ -69,8 +69,7 @@ class CloudSchedulerClient:
def create_job(self, parent, job):
"""Simulate create job."""
del parent
- if job['name'] not in self.schedulers:
- self.schedulers.append(job)
+ self.schedulers.append(job)
# pylint: disable=no-self-use
def job_path(self, project_id, location_id, name):
@@ -153,6 +152,31 @@ class TestDataSync(unittest.TestCase):
'test2': '0 7 * * *'
}, {project.name: project.schedule for project in projects_query})
+ self.assertCountEqual([
+ {
+ 'name':
+ 'projects/test-project/location/us-central1/jobs/test2-scheduler-fuzzing',
+ 'pubsub_target': {
+ 'topic_name': 'projects/test-project/topics/request-build',
+ 'data': b'test2'
+ },
+ 'schedule':
+ '0 7 * * *'
+ },
+ {
+ 'name':
+ 'projects/test-project/location/us-central1/jobs/test2-scheduler-coverage',
+ 'pubsub_target': {
+ 'topic_name':
+ 'projects/test-project/topics/request-coverage-build',
+ 'data':
+ b'test2'
+ },
+ 'schedule':
+ '0 6 * * *'
+ },
+ ], cloud_scheduler_client.schedulers)
+
def test_sync_projects_delete(self):
"""Testing sync_projects() deleting."""
cloud_scheduler_client = CloudSchedulerClient()