Пример #1
0
 def phase(self, node):
     w = Workplan()
     for i in node.tail:
         head = i.head
         value = i.tail[0]
         if head == 'work':
             w.work(int(value))
         elif head == 'wait':
             w.wait(int(value))
         elif head == 'launch':
             w.launch(str(value))
     print 'generated workplan', w
     return w
Пример #2
0
 def test_pop_02(self):
     #test pop from empty workplan
     wp = Workplan().work(10)
     wp.pop()
     #worplan now empty
     self.assertRaises(IndexError, wp.pop)
Пример #3
0
 def test_pop_01(self):
     #get the next section from the workplan.
     wp = Workplan().work(10).wait(20).work(30)
     # get first section
     section = wp.pop()
     self.assertEqual(Work(10), section)