Exemplo n.º 1
0
 def test_both_fields(self):
   """Test filter field and keyword field."""
   self.params['q'] = ('hello group:456 issue:123 platform:windows'
                       ' stable:s.1 beta:b.2 fuzzer:2 job:3')
   self.params['fuzzer'] = 'fuzz'
   self.params['issue'] = 'yes'
   self.params['job'] = 'somejob'
   self.params['open'] = 'yes'
   self.params['project'] = 'project'
   self.params['reproducible'] = 'yes'
   self.params['security'] = 'yes'
   self.params['impact'] = 'stable'
   testcase_list.add_filters(self.query, self.params)
   self.query.order.assert_called_once_with('timestamp', is_desc=True)
   self.query.filter.assert_has_calls([
       mock.call('status', 'Processed'),
       mock.call('is_a_duplicate_flag', False),
       mock.call('impact_version_indices', 'stable'),
       mock.call('has_bug_flag', True),
       mock.call('open', True),
       mock.call('security_flag', True),
       mock.call('group_id', 456),
       mock.call('bug_indices', '123'),
       mock.call('platform', 'windows'),
       mock.call('impact_stable_version_indices', 's.1'),
       mock.call('impact_beta_version_indices', 'b.2'),
       mock.call('fuzzer_name_indices', '2'),
       mock.call('job_type', '3'),
       mock.call('keywords', 'hello'),
       mock.call('one_time_crasher_flag', False),
       mock.call('job_type', 'somejob'),
       mock.call('fuzzer_name_indices', 'fuzz'),
       mock.call('project_name', 'project'),
   ])
Exemplo n.º 2
0
 def test_no_field(self):
   """Test no field."""
   testcase_list.add_filters(self.query, self.params)
   self.query.order.assert_called_once_with('timestamp', is_desc=True)
   self.query.filter.assert_has_calls([
       mock.call('status', 'Processed'),
       mock.call('is_a_duplicate_flag', False),
       mock.call('open', True),
       mock.call('is_leader', True)
   ])
Exemplo n.º 3
0
 def test_revision_greater_than(self):
   """Ensure that we change ordering when using revision_greater_than."""
   self.params['revision_greater_than'] = '123456'
   testcase_list.add_filters(self.query, self.params)
   self.query.order.assert_called_once_with('crash_revision', is_desc=True)
   self.query.filter.assert_has_calls([
       mock.call('status', 'Processed'),
       mock.call('is_a_duplicate_flag', False),
       mock.call('is_leader', True),
       mock.call('crash_revision', 123456, operator='>'),
   ])