コード例 #1
0
 def test_single_step(self):
     trace = [MacroStep(0, steps=[
         MicroStep(entered_states=['a', 'b', 'c'], transition=Transition('x')),
         MicroStep(entered_states=['a', 'b'], transition=Transition('x')),
         MicroStep(entered_states=['a']),
         MicroStep(entered_states=[])
     ])]
     self.assertEqual(coverage_from_trace(trace), (Counter(a=3, b=2, c=1), Counter({Transition('x'): 2})))
コード例 #2
0
    def test_multiple_steps(self):
        trace = [MacroStep(0, steps=[
            MicroStep(entered_states=['a', 'b', 'c'], transition=Transition('x')),
            MicroStep(entered_states=['a', 'b'], transition=Transition('x')),
            MicroStep(entered_states=['a']),
            MicroStep(entered_states=[])
        ])]

        trace.extend(trace)
        self.assertEqual(coverage_from_trace(trace), (Counter(a=6, b=4, c=2), Counter({Transition('x'): 4})))
コード例 #3
0
 def test_single_step(self):
     trace = [
         MacroStep(0,
                   steps=[
                       MicroStep(entered_states=['a', 'b', 'c'],
                                 transition=Transition('x')),
                       MicroStep(entered_states=['a', 'b'],
                                 transition=Transition('x')),
                       MicroStep(entered_states=['a']),
                       MicroStep(entered_states=[])
                   ])
     ]
     self.assertEqual(
         coverage_from_trace(trace),
         (Counter(a=3, b=2, c=1), Counter({Transition('x'): 2})))
コード例 #4
0
    def test_multiple_steps(self):
        trace = [
            MacroStep(0,
                      steps=[
                          MicroStep(entered_states=['a', 'b', 'c'],
                                    transition=Transition('x')),
                          MicroStep(entered_states=['a', 'b'],
                                    transition=Transition('x')),
                          MicroStep(entered_states=['a']),
                          MicroStep(entered_states=[])
                      ])
        ]

        trace.extend(trace)
        self.assertEqual(
            coverage_from_trace(trace),
            (Counter(a=6, b=4, c=2), Counter({Transition('x'): 4})))
コード例 #5
0
 def test_empty_trace(self):
     self.assertEqual(coverage_from_trace([]), (Counter(), Counter()))
コード例 #6
0
 def test_empty_trace(self):
     self.assertEqual(coverage_from_trace([]), (Counter(), Counter()))