Exemplo n.º 1
0
 def test_driver_with_no_cases(self):
     runner = MockRunner('')
     test, errors = run_one((runner, [], 'foo', 'foo'))
     assert ('foo' == test)
     assert (1 == len(runner.commands))
     assert (['foo', '1'] == runner.commands[0])
     assert (not errors)
Exemplo n.º 2
0
 def test_driver_with_executor(self):
     runner = MockRunner('')
     test, errors = run_one((runner, ['x', 'y'], 'foo', 'foo'))
     assert ('foo' == test)
     assert (1 == len(runner.commands))
     assert (['x', 'y', 'foo', '1'] == runner.commands[0])
     assert (not errors)
Exemplo n.º 3
0
 def test_driver_with_no_cases(self):
     runner = MockRunner('')
     test, errors = run_one((runner, 'foo'))
     assert('foo' == test)
     assert(1 == len(runner.commands))
     assert(['foo', '1'] == runner.commands[0])
     assert(not errors)
Exemplo n.º 4
0
 def test_driver_with_one_failure(self):
     runner = MockRunner('f')
     test, errors = run_one((runner, [], 'foo', 'foo'))
     assert ('foo' == test)
     assert (2 == len(runner.commands))
     assert (['foo', '1'] == runner.commands[0])
     assert (['foo', '2'] == runner.commands[1])
     assert (1 == len(errors))
     assert (1 in errors)
Exemplo n.º 5
0
 def test_driver_with_one_failure(self):
     runner = MockRunner('f')
     test, errors = run_one((runner, 'foo'))
     assert('foo' == test)
     assert(2 == len(runner.commands))
     assert(['foo', '1'] == runner.commands[0])
     assert(['foo', '2'] == runner.commands[1])
     assert(1 == len(errors))
     assert(1 in errors)
Exemplo n.º 6
0
 def test_driver_with_four_successes(self):
     runner = MockRunner('ssss')
     test, errors = run_one((runner, [], 'foo', 'foo'))
     assert ('foo' == test)
     assert (5 == len(runner.commands))
     assert (['foo', '1'] == runner.commands[0])
     assert (['foo', '2'] == runner.commands[1])
     assert (['foo', '3'] == runner.commands[2])
     assert (['foo', '4'] == runner.commands[3])
     assert (['foo', '5'] == runner.commands[4])
     assert (not errors)
Exemplo n.º 7
0
 def test_driver_with_four_successes(self):
     runner = MockRunner('ssss')
     test, errors = run_one((runner, 'foo'))
     assert('foo' == test)
     assert(5 == len(runner.commands))
     assert(['foo', '1'] == runner.commands[0])
     assert(['foo', '2'] == runner.commands[1])
     assert(['foo', '3'] == runner.commands[2])
     assert(['foo', '4'] == runner.commands[3])
     assert(['foo', '5'] == runner.commands[4])
     assert(not errors)
Exemplo n.º 8
0
 def test_driver_with_mixed_successes_failures(self):
     runner = MockRunner('sfsf')
     test, errors = run_one((runner, [], 'foo', 'foo'))
     assert ('foo' == test)
     assert (5 == len(runner.commands))
     assert (['foo', '1'] == runner.commands[0])
     assert (['foo', '2'] == runner.commands[1])
     assert (['foo', '3'] == runner.commands[2])
     assert (['foo', '4'] == runner.commands[3])
     assert (['foo', '5'] == runner.commands[4])
     assert (2 == len(errors))
     assert (2 in errors)
     assert (4 in errors)
Exemplo n.º 9
0
 def test_driver_with_mixed_successes_failures(self):
     runner = MockRunner('sfsf')
     test, errors = run_one((runner, 'foo'))
     assert('foo' == test)
     assert(5 == len(runner.commands))
     assert(['foo', '1'] == runner.commands[0])
     assert(['foo', '2'] == runner.commands[1])
     assert(['foo', '3'] == runner.commands[2])
     assert(['foo', '4'] == runner.commands[3])
     assert(['foo', '5'] == runner.commands[4])
     assert(2 == len(errors))
     assert(2 in errors)
     assert(4 in errors)