Esempio n. 1
0
    def setUp(self):
        self.user = "******"
        self.types_dict = vtypes.get_types(dummytypes)
        self.rt = vrt.load_reference_tree(self.types_dict, xmls, schema_path)

        self.config_tree = vct.ConfigNode("root")
        self.validator = vrt.PathValidator(tree=self.rt, types=self.types_dict)
Esempio n. 2
0
    def setUp(self):
        self.user = "******"
        self.types_dict = vtypes.get_types(dummytypes)
        self.rt = vrt.load_reference_tree(
            self.types_dict,
            xmls,
            schema_path)

        self.config_tree = vct.ConfigNode("root")
        self.validator = vrt.PathValidator(tree=self.rt, types=self.types_dict)
Esempio n. 3
0
    def setUp(self):
        self.types_dict = types.get_types(dummytypes)

        self.reference_tree = reftree.ReferenceNode('root')
        data_dir = os.environ["VYCONF_DATA_DIR"]
        test_data_dir = os.environ["VYCONF_TEST_DATA_DIR"]
        xml_file = os.path.join(test_data_dir, "interface_definition_validation_test.xml")
        schema_file = os.path.join(data_dir, "schemata", "interface_definition.rng")
        loader = reftree.ReferenceTreeLoader(xml_file, self.types_dict, schema=schema_file)
        loader.load(self.reference_tree)
        
        self.validator = reftree.PathValidator(self.types_dict, self.reference_tree)
Esempio n. 4
0
    def setUp(self):
        super(TestVytreePathValidator, self).setUp()
        self.types_dict = types.get_types(dummytypes)

        self.reference_tree = reftree.ReferenceNode('root')

        loader = self.get_loader(
            'interface_definition_validation_test.xml',
            self.types_dict,
            'schemas/interface_definition.rng')
        loader.load(self.reference_tree)

        self.validator = reftree.PathValidator(
            self.types_dict, self.reference_tree)
Esempio n. 5
0
    def setUp(self):
        super(TestVytreePathValidator, self).setUp()
        self.types_dict = types.get_types(dummytypes)

        self.reference_tree = reftree.ReferenceNode('root')

        loader = self.get_loader(
            'interface_definition_validation_test.xml',
            self.types_dict,
            'schemas/interface_definition.rng')
        loader.load(self.reference_tree)

        self.validator = reftree.PathValidator(
            self.types_dict, self.reference_tree)
Esempio n. 6
0
    def setUp(self):
        self.parser = vcurly.Parser()
        self.user = "******"
        self.types_dict = vtypes.get_types(dummytypes)
        self.rt = vrt.load_reference_tree(self.types_dict, xmls, schema_path)

        self.config_tree = vct.ConfigNode("root")
        self.validator = vrt.PathValidator(tree=self.rt, types=self.types_dict)

        self.session = vsession.Session(self.config_tree, self.validator,
                                        self.user)
        self.session.configure()

        ast = self.parser.parse(TEST_CONFIG)
        vcurly.load(ast, self.session)
Esempio n. 7
0
    def setUp(self):
        self.types_dict = types.get_types(dummytypes)

        self.reference_tree = reftree.ReferenceNode('root')
        data_dir = os.environ["VYCONF_DATA_DIR"]
        test_data_dir = os.environ["VYCONF_TEST_DATA_DIR"]
        xml_file = os.path.join(test_data_dir,
                                "interface_definition_validation_test.xml")
        schema_file = os.path.join(data_dir, "schemata",
                                   "interface_definition.rng")
        loader = reftree.ReferenceTreeLoader(xml_file,
                                             self.types_dict,
                                             schema=schema_file)
        loader.load(self.reference_tree)

        self.validator = reftree.PathValidator(self.types_dict,
                                               self.reference_tree)
Esempio n. 8
0
    def setUp(self):
        self.parser = vcurly.Parser()
        self.user = "******"
        self.types_dict = vtypes.get_types(dummytypes)
        self.rt = vrt.load_reference_tree(
            self.types_dict,
            xmls,
            schema_path)

        self.config_tree = vct.ConfigNode("root")
        self.validator = vrt.PathValidator(tree=self.rt, types=self.types_dict)

        self.session = vsession.Session(
            self.config_tree,
            self.validator,
            self.user)
        self.session.configure()

        ast = self.parser.parse(TEST_CONFIG)
        vcurly.load(ast, self.session)
Esempio n. 9
0
 def test_get_types_values(self):
     self.assertTrue(issubclass(types.get_types(MockTypeSet)["a_type"],
                                types.TypeValidator))
Esempio n. 10
0
 def test_get_types_keys(self):
     mock = sorted(list(types.get_types(MockTypeSet).keys()))
     self.assertEqual(mock, ["a_type", "b_type"])
Esempio n. 11
0
 def test_get_types_values(self):
     self.assertTrue(issubclass(types.get_types(MockTypeSet)["a_type"], types.TypeValidator))
Esempio n. 12
0
 def test_get_types_keys(self):
     self.assertEqual(sorted(list(types.get_types(MockTypeSet).keys())), ["a_type", "b_type"])