Exemplo n.º 1
0
 def job(self):
     job = model.Job('job')
     job.skip_if_matcher = cm.MatchAll([
         cm.ProjectMatcher('^project$'),
         cm.MatchAllFiles([cm.FileMatcher('^docs/.*$')]),
     ])
     return job
Exemplo n.º 2
0
 def test_repr(self):
     matcher = cm.MatchAll([])
     self.assertEqual(repr(matcher), '<MatchAll>')
Exemplo n.º 3
0
 def test_str(self):
     matcher = cm.MatchAll([cm.FileMatcher('foo')])
     self.assertEqual(str(matcher), '{MatchAll:{FileMatcher:foo}}')
Exemplo n.º 4
0
 def test_matches_returns_false_for_missing_matcher(self):
     matcher = cm.MatchAll([cm.ProjectMatcher('not_project')])
     self.assertFalse(matcher.matches(self.change))
Exemplo n.º 5
0
 def test_matches_returns_true(self):
     matcher = cm.MatchAll([cm.ProjectMatcher(self.project)])
     self.assertTrue(matcher.matches(self.change))