コード例 #1
0
ファイル: test_validators.py プロジェクト: brightcove/shhh
    def test_secret(self):
        not_valid = (None, "", 151 * "*")
        with self.assertRaises(ValidationError):
            for s in not_valid:
                Validator.secret(s)

        self.assertIsNone(Validator.secret(30 * "*"))
コード例 #2
0
ファイル: test_validators.py プロジェクト: smallwat3r/shhh
    def test_secret(self):
        # We need the app context as we need to access the app config
        app = create_app(env="testing")
        app_context = app.app_context()
        app_context.push()

        not_valid = (None, "", 251 * "*")
        for s in not_valid:
            with self.assertRaises(ValidationError):
                Validator.secret(s)

        self.assertIsNone(Validator.secret(30 * "*"))