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

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

src/m/i/milkcheck-HEAD/tests/MilkCheckTests/EngineTests/ActionTest.py   milkcheck(Download)
        action1 = Action('status', command='/bin/true')
        service = Service('TEST')
        service.add_actions(action1)
        self.assertEqual(action1.desc, None)
 
        # Service description, actions inherits the description
        action2 = Action('status', command='/bin/true')
        service2 = Service('TEST2')
        service2.desc = "Service TEST"
        service2.add_actions(action2)
        a2 = Action(name='status', command='/bin/true', delay=1)
        ser = Service('TEST')
        ser.add_actions(a1, a2)
        a1.run()
        a2.run()
        ser = Service('TEST')
        a1.add_dep(a2)
        ser.add_actions(a1, a2)
        a1.run()
        self.assertEqual(a1.status, DONE)
        ser = Service('TEST')
        a1.add_dep(a2)
        ser.add_actions(a1, a2)
        a1.run()
        self.assertEqual(a1.status, DONE)

src/m/i/milkcheck-HEAD/tests/MilkCheckTests/EngineTests/ServiceTest.py   milkcheck(Download)
        act_b = Action('stop', command='/bin/true')
        act_c = Action('status', command='/bin/true')
        service.add_actions(act_a, act_b, act_c)
        self.assertTrue(service.has_action('start'))
        self.assertTrue(service.has_action('stop'))
        act_status = Action('status', command='/bin/true')
        act_start.add_dep(target=act_status)
        serv.add_actions(act_start, act_status)
        serv.run('start')
        self.assertEqual(serv.status, DONE)
        act_status_fail = Action('status', command='/bin/false')
        act_start.add_dep(target=act_status_fail)
        serv.add_actions(act_start, act_status_fail)
        serv.run('start')
        self.assertEqual(serv.status, DONE)
 
        nemesis.add_action(act_start1)
        zombie_one.add_actions(act_start2, act_sta_fai)
        zombie_two.add_action(act_start3)
        hive.add_actions(act_start4, act_sta)

src/m/i/milkcheck-HEAD/tests/MilkCheckTests/UITests/CliTest.py   milkcheck(Download)
        stop_svc1 = Action('stop', HOSTNAME + ',BADNODE', '/bin/true')
        stop_svc1.delay = 1
        svc1.add_actions(start_svc1, stop_svc1)
        # Actions S2
        svc2.add_action(Action('start', HOSTNAME + ',BADNODE', '/bin/true'))