Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(185)  |  Call(185)  |  Derive(0)  |  Import(0)

src/m/i/milkcheck-HEAD/tests/MilkCheckTests/EngineTests/ServiceTest.py   milkcheck(Download)
        ser1.target = '127.0.0.1'
        ser2 = Service('inherited')
        ser2.add_action(Action('start'))
        ser2.add_action(Action('stop', "foo"))
        ser2.inherits_from(ser1)
    def test_update_target(self):
        '''Test update of the target of an service'''
        serv = Service('A')
        act = Action('start', 'fortoy[5-10]', '/bin/true')
        serv.add_action(act)
        service.origin = True
        action.status = DONE 
        service.add_action(action)
        service._last_action = 'start'
        service.reset()
    def test_add_action(self):
        """Test add_action's behaviour."""
        service = Service('brutus')
        service.add_action(Action('start'))
        self.assertTrue(service.has_action('start'))

src/m/i/milkcheck-HEAD/tests/MilkCheckTests/ServiceManagerTest.py   milkcheck(Download)
        s3 = Service('S3')
        s4 = Service('S4')
        s1.add_action(Action('start', command='/bin/true'))
        s2.add_action(Action('start', command='/bin/true'))
        s3.add_action(Action('start', command='/bin/true'))
        s4.add_action(Action('start', command='/bin/true'))
        s3 = Service('S3')
        s4 = Service('S4')
        s1.add_action(Action('start', command='/bin/true'))
        s2.add_action(Action('start', command='/bin/true'))
        s3.add_action(Action('start', command='/bin/true'))

src/m/i/milkcheck-HEAD/tests/MilkCheckTests/EngineTests/ActionTest.py   milkcheck(Download)
    def test_skipped_action_overload(self):
        """Test action is not skipped if they overload target."""
        # A dep on ERROR
        dep = Service('dep')
        dep.add_action(Action('start', command='/bin/false'))
        # A service running on empty nodeset...
        svc = Service('foo', target='@NOTEXIST')
        # ... with an action overloading the empty nodeset
        svc.add_action(Action('start', target=HOSTNAME, command=':'))
 
        svc = Service('foo')
        svc.add_action(action)
        self.assertEqual(action._resolve("I'm %SERVICE.%ACTION"), "I'm foo.bar")
 
        action.errors = 2
        service = Service('test_service')
        service.add_action(action)
        service.run('start')
        self.assertEqual(action.nb_errors(), 3)
    def test_nb_errors_remote2(self):
        """Test the method nb_errors() with no error (remote)."""
        action = Action(name='test', target=HOSTNAME, command='/bin/true')
        service = Service('test_service')
        service.add_action(action)

src/m/i/milkcheck-HEAD/tests/MilkCheckTests/UITests/CliTest.py   milkcheck(Download)
        svc2.add_action(Action('stop', HOSTNAME + ',BADNODE', '/bin/true'))
        # Actions S3
        svc3.add_action(Action('start', HOSTNAME + ',BADNODE', '/bin/false'))
        svc3.add_action(Action('stop', HOSTNAME + ',BADNODE', '/bin/false'))
        # Actions I1
        inter1.add_action(Action('start', HOSTNAME, 'echo ok'))
        inter1.add_action(Action('stop', HOSTNAME, 'echo ok'))
        # Actions I2
        inter2.add_action(Action('start', HOSTNAME + ',BADNODE', '/bin/true'))

src/m/i/milkcheck-HEAD/tests/MilkCheckTests/EngineTests/ServiceGroupTest.py   milkcheck(Download)
        action.retry = 3
        action.status = DONE
        ser1.add_action(action)
        ser1.status = ERROR
        group.add_inter_dep(target=ser1)
    def test_add_dep_service_group(self):
        '''Test ability to add dependencies to a ServiceGroup'''
        ser_group = ServiceGroup('GROUP')
        s1 = Service('alpha')
        s1.add_action(Action('start', HOSTNAME, '/bin/true'))
        s2 = Service('beta')
        s2.add_action(Action('action', HOSTNAME, '/bin/true'))
        self.assertTrue(s3.name in ser_group.parents)
        s4 = Service('theta')
        s4.add_action(Action('fire', HOSTNAME,'/bin/true'))
        ser_group.add_dep(target=s4, parent=False)
        self.assertTrue(s4.name in ser_group.children)
    def test_prepare_group_subservice(self):
        '''Test prepare group with an internal dependency.'''
        group = ServiceGroup('GROUP')
        subserv = Service('SUB1')
        subserv.add_action(Action('start', command='/bin/true'))

src/m/i/milkcheck-HEAD/tests/MilkCheckTests/EngineTests/CoreTests.py   milkcheck(Download)
        grp1_i2 = Service('I2')
        grp1_i3 = Service('I3')
        grp1_i1.add_action(Action('start', command='/bin/true'))
        grp1_i2.add_action(Action('start', command='/bin/true'))
        grp1_i2.add_action(Action('status', command='/bin/true'))
        grp1_i3.add_action(Action('start', command='/bin/true'))
        grp2_i1 = Service('I1')
        grp2_i2 = Service('I2')
        grp2_i1.add_action(Action('start', command='/bin/false'))
        grp2_i2.add_action(Action('start', command='/bin/true'))
        grp2.add_inter_dep(target=grp2_i1)