<commit_before>#! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2014 Spotify AB
from __future__ import absolute_import, division, print_function

import os

from ramlfications.validate import RAMLValidationError, validate

from .base import BaseTestCase


class TestValidateRAML(BaseTestCase):
    def setUp(self):
        self.here = os.path.abspath(os.path.dirname(__file__))

    def fail_validate(self, raml_file, expected_msg):
        e = self.assert_raises(RAMLValidationError, validate,
                               ramlfile=raml_file)
<commit_msg>tests for load within validate<commit_after>#! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2014 Spotify AB
from __future__ import absolute_import, division, print_function

import os

from ramlfications.loader import load
from ramlfications.validate import RAMLValidationError, validate

from .base import BaseTestCase


class TestValidateRAML(BaseTestCase):
    def setUp(self):
        self.here = os.path.abspath(os.path.dirname(__file__))

    def fail_validate(self, raml_file, expected_msg):
        self.load_object = load(raml_file)
        e = self.assert_raises(RAMLValidationError, validate,
                               load_object=self.load_object)

{'fraction_non_alphanumeric': 0.08945686900958466, 'fraction_numerical': 0.007987220447284345, 'mean_word_length': 3.623616236162362, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '624490', 'n_tokens_mistral': 387, 'n_tokens_neox': 372, 'n_words': 92}