Example #1
0
class PathValidatorTestCase(unittest.TestCase):
    def setUp(self):
        super(PathValidatorTestCase, self).setUp()
        self.validator = PathValidator()

    def test_check_path(self):
        valid_path = '/api'
        self.assertIsNone(self.validator.validate(valid_path))

    def test_check_path_failed(self):
        invalid_path = 'api'
        self.assertRaises(InvalidPathArgument, self.validator.validate,
                          invalid_path)
Example #2
0
class PathValidatorTestCase(unittest.TestCase):

    def setUp(self):
        super(PathValidatorTestCase, self).setUp()
        self.validator = PathValidator()

    def test_check_path(self):
        valid_path = '/api'
        self.assertIsNone(self.validator.validate(valid_path))

    def test_check_path_failed(self):
        invalid_path = 'api'
        self.assertRaises(
            InvalidPathArgument,
            self.validator.validate, invalid_path
        )
Example #3
0
 def setUp(self):
     super(PathValidatorTestCase, self).setUp()
     self.validator = PathValidator()
Example #4
0
 def setUp(self):
     super(PathValidatorTestCase, self).setUp()
     self.validator = PathValidator()