Exemplo n.º 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)
Exemplo n.º 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
        )
Exemplo n.º 3
0
 def setUp(self):
     super(PathValidatorTestCase, self).setUp()
     self.validator = PathValidator()
Exemplo n.º 4
0
 def setUp(self):
     super(PathValidatorTestCase, self).setUp()
     self.validator = PathValidator()