def test_invalid_path_error(self): with self.assertRaises(InvalidPathError): run(None, None, None, None, None, ['walk', 'foo']) stderr = StringIO() main(None, stderr, None, None, None, [__name__, 'walk', 'foo']) assert(stderr.getvalue())
def test_no_config_error(self): with self.assertRaises(NoConfigError): run(None, None, None, None, None, ['walk', 'foo']) stderr = StringIO() main(None, stderr, None, None, None, [__name__, 'walk', 'foo']) assert(stderr.getvalue())
def test_args_error_if_config_unneeded(self): with self.assertRaises(InvalidArgumentsError): run(None, None, None, None, None, []) stderr = StringIO() main(None, stderr, None, None, None, [__name__]) assert(stderr.getvalue())
def test_not_found_error(self): stdout = StringIO() stderr = StringIO() main(stdout, stderr, None, None, None, [__name__, 'walk', 'p5']) assert(not stdout.getvalue()) assert(stderr.getvalue()) assert('p5' in stderr.getvalue())
def test_not_found_error(self): stdout = StringIO() stderr = StringIO() main(stdout, stderr, None, None, None, [__name__, 'walk', 'p5']) assert (not stdout.getvalue()) assert (stderr.getvalue()) assert ('p5' in stderr.getvalue())
def test_no_config_error(self): with self.assertRaises(NoConfigError): run(None, None, None, None, None, ['walk', 'foo']) stderr = StringIO() main(None, stderr, None, None, None, [__name__, 'walk', 'foo']) assert (stderr.getvalue())
def test_args_error_if_config_unneeded(self): with self.assertRaises(InvalidArgumentsError): run(None, None, None, None, None, []) stderr = StringIO() main(None, stderr, None, None, None, [__name__]) assert (stderr.getvalue())
def test_invalid_path_error(self): with self.assertRaises(InvalidPathError): run(None, None, None, None, None, ['walk', 'foo']) stderr = StringIO() main(None, stderr, None, None, None, [__name__, 'walk', 'foo']) assert (stderr.getvalue())
def test_cyclic_error(self): stdout = StringIO() stderr = StringIO() main(stdout, stderr, None, None, None, [__name__, 'walk', 'p3']) assert(not stdout.getvalue()) assert(stderr.getvalue()) assert('p3' in stderr.getvalue()) assert('p4' in stderr.getvalue())
def test_cyclic_error(self): stdout = StringIO() stderr = StringIO() main(stdout, stderr, None, None, None, [__name__, 'walk', 'p3']) assert (not stdout.getvalue()) assert (stderr.getvalue()) assert ('p3' in stderr.getvalue()) assert ('p4' in stderr.getvalue())
def test_no_config_error(self): stdout = StringIO() stderr = StringIO() main(stdout, stderr, None, None, [__name__, 'walk', 'bdemeta.json', 'p1']) assert(not stdout.getvalue()) assert(stderr.getvalue())
def test_running_tests(self): stdout1 = StringIO() stderr1 = StringIO() runner1 = MockRunner('sfsf') main(stdout1, stderr1, None, runner1, lambda: 80, [__name__, 'runtests', 'foo']) stdout2 = StringIO() stderr2 = StringIO() runner2 = MockRunner('sfsf') run_tests(stdout2, stderr2, runner2, lambda: 80, ['foo']) assert (stdout1.getvalue() == stdout2.getvalue()) assert (stderr1.getvalue() == stderr2.getvalue()) assert (runner1.commands == runner2.commands)
def test_running_tests(self): stdout1 = StringIO() stderr1 = StringIO() runner1 = MockRunner('sfsf') main(stdout1, stderr1, runner1, lambda: 80, [__name__, 'runtests', 'foo']) stdout2 = StringIO() stderr2 = StringIO() runner2 = MockRunner('sfsf') run_tests(stdout2, stderr2, runner2, lambda: 80, ['foo']) assert(stdout1.getvalue() == stdout2.getvalue()) assert(stderr1.getvalue() == stderr2.getvalue()) assert(runner1.commands == runner2.commands)
def test_walk(self): stdout = StringIO() main(stdout, None, None, None, None, [None, 'walk', 'p2']) assert ('p2 p1\n' == stdout.getvalue())
def test_walk(self): stdout = StringIO() main(stdout, None, None, None, None, [None, 'walk', 'p2']) assert('p2 p1\n' == stdout.getvalue())
def test_error(self): stdout = StringIO() stderr = StringIO() main(stdout, stderr, None, None, None, [__name__, 'foo']) assert(not stdout.getvalue()) assert(stderr.getvalue())
def test_no_config_error(self): stdout = StringIO() stderr = StringIO() main(stdout, stderr, None, None, None, [__name__, 'walk', 'p1']) assert (not stdout.getvalue()) assert (stderr.getvalue())
def test_help_text(self): stdout = StringIO() stderr = StringIO() main(stdout, stderr, None, None, None, [__name__]) assert (not stdout.getvalue()) assert (stderr.getvalue())
def test_help_text(self): stdout = StringIO() stderr = StringIO() main(stdout, stderr, None, None, None, [__name__]) assert(not stdout.getvalue()) assert(stderr.getvalue())
def test_error(self): stdout = StringIO() stderr = StringIO() main(stdout, stderr, None, None, None, [__name__, 'foo']) assert (not stdout.getvalue()) assert (stderr.getvalue())