# -*- encoding: UTF8 -*- from __future__ import print_function import sys import unittest from JobsCmdFilter import JobsCmdFilter python3 = sys.version_info[0] >= 3 class TestJobsCmdFilter(unittest.TestCase): def __init__(self, methodName='runTest'): super(TestJobsCmdFilter, self).__init__(methodName=methodName) def assertRegex(self, *args, **kwargs): if python3: return super(TestJobsCmdFilter, self).assertRegex(*args, **kwargs) else: return super(TestJobsCmdFilter, self).assertRegexpMatches(*args, **kwargs) def setUp(self): pass def tearDown(self): pass def testJobsFilter(self): "ordinary jobs command is OK" trig = JobsCmdFilter() self.assertEqual(0, trig.run()) trig = JobsCmdFilter("") self.assertEqual(0, trig.run()) trig = JobsCmdFilter('-e', 'new') self.assertEqual(0, trig.run()) trig = JobsCmdFilter("-r", "-m100", "-e", "Summary='****'") self.assertEqual(1, trig.run()) trig = JobsCmdFilter("-r", "-m100", "-e", "Summary='**'") self.assertEqual(1, trig.run()) trig = JobsCmdFilter("-r", "-e", "fred**") self.assertEqual(1, trig.run()) if __name__ == '__main__': unittest.main()
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#3 | 23331 | C. Thomas Tyler |
Released SDP 2017.4.23329 (2017/12/05). Copy Up using 'p4 copy -r -b perforce_software-sdp-dev'. |
||
#2 | 18676 | Robert Cowham |
Use new trigger framework for JobsCmdFilter. Trap more variants of * in search strings. |
||
#1 | 18204 | Robert Cowham | New trigger to filter jobs commands plus test harness |