| Index: recipe_engine/unittests/recipe_test_api_test.py
|
| diff --git a/recipe_engine/unittests/recipe_test_api_test.py b/recipe_engine/unittests/recipe_test_api_test.py
|
| index 9f0d29eba55959989729269bc7a9642d239fddf9..31515da3a3d969d6349ad278b853987e2abc83d7 100755
|
| --- a/recipe_engine/unittests/recipe_test_api_test.py
|
| +++ b/recipe_engine/unittests/recipe_test_api_test.py
|
| @@ -15,7 +15,7 @@ class EXC(Exception):
|
| class TestExpectedException(unittest.TestCase):
|
| def testRecognizeException(self):
|
| """An expected exception is correctly recognized."""
|
| - test_data = recipe_test_api.TestData()
|
| + test_data = recipe_test_api.TestData("test")
|
| test_data.expect_exception(EXC.__name__)
|
| self.assertFalse(test_data.consumed)
|
|
|
| @@ -29,7 +29,7 @@ class TestExpectedException(unittest.TestCase):
|
|
|
| def testNewException(self):
|
| """An unexpected exception results in being told to re-raise ."""
|
| - test_data = recipe_test_api.TestData()
|
| + test_data = recipe_test_api.TestData("test")
|
| self.assertTrue(test_data.consumed)
|
|
|
| with test_data.should_raise_exception(EXC()) as should_raise:
|
| @@ -39,10 +39,18 @@ class TestExpectedException(unittest.TestCase):
|
|
|
| def testDisabledTestData(self):
|
| """Disabled test data correctly re-raises all exceptions."""
|
| - test_data = recipe_test_api.TestData()
|
| + test_data = recipe_test_api.TestData("test")
|
|
|
| with test_data.should_raise_exception(EXC()) as should_raise:
|
| self.assertTrue(should_raise)
|
|
|
| + def test_invalid_test_names(self):
|
| + for bad in ('bad name', 'a\////', 'b\\\\', 'c(*#&($'):
|
| + self.assertFalse(recipe_test_api.is_valid_test_name(bad))
|
| +
|
| + def test_valid_test_names(self):
|
| + for good in ('good', 'with_underscores_now', 'and_numbers_1'):
|
| + self.assertTrue(recipe_test_api.is_valid_test_name(good))
|
| +
|
| if __name__ == '__main__':
|
| unittest.main()
|
|
|