def testFixupSeedSteps(self):
     for (inp, exp) in [([S(1)], [S(1)]), ([S(1), S(2)], [S(1, 1, 2),
                                                          S(2)]),
                        ([S(1), [S(2), S(3)]], [S(1, 1, 2, 3),
                                                S(2),
                                                S(3)]),
                        ([[S(1), S(2)], S(3)], [S(1, 1, 2, 3),
                                                S(2),
                                                S(3)]), (G(S(1)), [S(1)]),
                        (G(S(1), S(2)), [S(1), S(2)]),
                        ([S(1), G(S(2), S(3))], [S(1, 1, 2),
                                                 S(2),
                                                 S(3)]),
                        ([G(S(1), S(2)), S(3)], [S(1), S(2),
                                                 S(3)]),
                        (G(S(1), G(S(2), S(3))), [S(1), S(2),
                                                  S(3)]),
                        (G(G(S(1), S(2)), S(3)), [S(1), S(2),
                                                  S(3)]),
                        (G(S(1), [S(2), S(3)]), [S(1),
                                                 S(2, 2, 3),
                                                 S(3)]),
                        (G([S(1), S(2)], S(3)), [S(1, 1, 2),
                                                 S(2),
                                                 S(3)]),
                        (G([G(S(1)), S(2)], [S(3)],
                           [G(S(4), S(5)), S(6)]),
                         [S(1), S(2), S(3),
                          S(4), S(5), S(6)])]:
         self.assertEquals(exp, list(annotated_run.fixup_seed_steps(inp)))
Beispiel #2
0
 def testFixupSeedSteps(self):
   for (inp, exp) in [
       ([S(1)],
        [S(1)]),
       ([S(1), S(2)],
        [S(1, 1, 2), S(2)]),
       ([S(1), [S(2), S(3)]],
        [S(1, 1, 2, 3), S(2), S(3)]),
       ([[S(1), S(2)], S(3)],
        [S(1, 1, 2, 3), S(2), S(3)]),
       (G(S(1)),
        [S(1)]),
       (G(S(1), S(2)),
        [S(1), S(2)]),
       ([S(1), G(S(2), S(3))],
        [S(1, 1, 2), S(2), S(3)]),
       ([G(S(1), S(2)), S(3)],
        [S(1), S(2), S(3)]),
       (G(S(1), G(S(2), S(3))),
        [S(1), S(2), S(3)]),
       (G(G(S(1), S(2)), S(3)),
        [S(1), S(2), S(3)]),
       (G(S(1), [S(2), S(3)]),
        [S(1), S(2, 2, 3), S(3)]),
       (G([S(1), S(2)], S(3)),
        [S(1, 1, 2), S(2), S(3)]),
       (G([G(S(1)), S(2)], [S(3)], [G(S(4), S(5)), S(6)]),
        [S(1), S(2), S(3), S(4), S(5), S(6)])]:
     self.assertEquals(exp, list(annotated_run.fixup_seed_steps(inp)))
    def testFixupSeedStepsTypeErrors(self):
        def Raise():
            yield S(1)
            raise TypeError

        self.assertRaises(
            TypeError, lambda: list(annotated_run.fixup_seed_steps(Raise())))
Beispiel #4
0
  def testFixupSeedStepsTypeErrors(self):
    def Raise():
      yield S(1)
      raise TypeError

    self.assertRaises(TypeError,
                      lambda: list(annotated_run.fixup_seed_steps(Raise())))