Example #1
0
 def test_pauses(self):
     trace = [
         MacroStep(0, []),
         MacroStep(10, []),
         MacroStep(10, []),
         MacroStep(15, []),
     ]
     self.assertListEqual(story_from_trace(trace), [Pause(10), Pause(5)])
Example #2
0
 def test_events_and_pauses(self):
     trace = [
         MacroStep(2, [MicroStep(Event('a'))]),
         MacroStep(5, [MicroStep(Event('b'))]),
         MacroStep(9, [MicroStep(Event('c'))]),
         MacroStep(14, [MicroStep(Event('d'))]),
     ]
     self.assertListEqual(story_from_trace(trace), [
         Pause(2), Event('a'), Pause(3), Event('b'), Pause(4), Event('c'), Pause(5), Event('d')
     ])
Example #3
0
 def test_pauses(self):
     trace = [
         MacroStep(0, []),
         MacroStep(10, []),
         MacroStep(10, []),
         MacroStep(15, []),
     ]
     self.assertListEqual(story_from_trace(trace), [
         Pause(10), Pause(5)
     ])
Example #4
0
 def test_events(self):
     trace = [
         MacroStep(0, [MicroStep(Event('a'))]),
         MacroStep(0, [MicroStep(Event('b'))]),
         MacroStep(0, [MicroStep(Event('c'))]),
         MacroStep(0, [MicroStep(Event('d'))]),
     ]
     self.assertListEqual(story_from_trace(trace), [
         Event('a'), Event('b'), Event('c'), Event('d')
     ])
Example #5
0
 def test_ignore_internal_events(self):
     trace = [
         MacroStep(2, [MicroStep(event=Event('a'))]),
         MacroStep(5, [MicroStep(event=Event('b'))]),
         MacroStep(9, [MicroStep(event=InternalEvent('c'))]),
         MacroStep(14, [MicroStep(event=Event('d'))]),
     ]
     self.assertListEqual(story_from_trace(trace), [
         Pause(2), Event('a'), Pause(3), Event('b'), Pause(4), Pause(5), Event('d')
     ])
Example #6
0
 def test_events(self):
     trace = [
         MacroStep(0, [MicroStep(Event('a'))]),
         MacroStep(0, [MicroStep(Event('b'))]),
         MacroStep(0, [MicroStep(Event('c'))]),
         MacroStep(0, [MicroStep(Event('d'))]),
     ]
     self.assertListEqual(
         story_from_trace(trace),
         [Event('a'), Event('b'),
          Event('c'), Event('d')])
Example #7
0
 def test_ignore_internal_events(self):
     trace = [
         MacroStep(2, [MicroStep(Event('a'))]),
         MacroStep(5, [MicroStep(Event('b'))]),
         MacroStep(9, [MicroStep(InternalEvent('c'))]),
         MacroStep(14, [MicroStep(Event('d'))]),
     ]
     self.assertListEqual(story_from_trace(trace), [
         Pause(2),
         Event('a'),
         Pause(3),
         Event('b'),
         Pause(4),
         Pause(5),
         Event('d')
     ])
Example #8
0
 def test_events_and_pauses(self):
     trace = [
         MacroStep(2, [MicroStep(event=Event('a'))]),
         MacroStep(5, [MicroStep(event=Event('b'))]),
         MacroStep(9, [MicroStep(event=Event('c'))]),
         MacroStep(14, [MicroStep(event=Event('d'))]),
     ]
     self.assertListEqual(story_from_trace(trace), [
         Pause(2),
         Event('a'),
         Pause(3),
         Event('b'),
         Pause(4),
         Event('c'),
         Pause(5),
         Event('d')
     ])
Example #9
0
 def test_initial_pause(self):
     trace = [MacroStep(10, [])]
     self.assertListEqual(story_from_trace(trace), [Pause(10)])
Example #10
0
 def test_empty_trace(self):
     trace = []
     self.assertListEqual(story_from_trace(trace), [])
Example #11
0
 def test_initial_pause(self):
     trace = [MacroStep(10, [])]
     self.assertListEqual(story_from_trace(trace), [Pause(10)])
Example #12
0
 def test_empty_trace(self):
     trace = []
     self.assertListEqual(story_from_trace(trace), [])