Example #1
0
 def test_project_bucket(self):
     predicate = rpc_pb2.BuildPredicate(builder=dict(project='chromium',
                                                     bucket='try'), )
     q = api.build_predicate_to_search_query(predicate)
     self.assertFalse(q.project)
     self.assertEqual(q.bucket_ids, ['chromium/try'])
     self.assertFalse(q.tags)
Example #2
0
 def test_create_time(self):
     predicate = rpc_pb2.BuildPredicate()
     predicate.create_time.start_time.FromDatetime(
         datetime.datetime(2018, 1, 1))
     predicate.create_time.end_time.FromDatetime(
         datetime.datetime(2018, 1, 2))
     q = api.build_predicate_to_search_query(predicate)
     self.assertEqual(q.create_time_low, datetime.datetime(2018, 1, 1))
     self.assertEqual(q.create_time_high, datetime.datetime(2018, 1, 2))
Example #3
0
 def test_non_canary(self):
     predicate = rpc_pb2.BuildPredicate(canary=common_pb2.NO)
     q = api.build_predicate_to_search_query(predicate)
     self.assertEqual(q.canary, False)
Example #4
0
 def test_build_range(self):
     predicate = rpc_pb2.BuildPredicate(build=rpc_pb2.BuildRange(
         start_build_id=100, end_build_id=90), )
     q = api.build_predicate_to_search_query(predicate)
     self.assertEqual(q.build_low, 89)
     self.assertEqual(q.build_high, 101)