Ejemplo n.º 1
0
	def testAttributeExists(self):
		"""
		This method tests :meth:`foundations.parsers.SectionsFileParser.attributeExists` method.
		"""

		for type, file in STANDARD_FILES.iteritems():
			sectionsFileParser = SectionsFileParser(file)
			sectionsFileParser.read() and sectionsFileParser.parse(False, rawSections=STANDARD_FILES_RAW_SECTIONS[type])
			for attribute in RANDOM_ATTRIBUTES[type]:
				self.assertTrue(sectionsFileParser.attributeExists(attribute, namespace.getNamespace(attribute,
																									rootOnly=True)))
				self.assertFalse(sectionsFileParser.attributeExists("Unknown", namespace.getNamespace(attribute,
																									rootOnly=True)))
Ejemplo n.º 2
0
    def testAttributeExists(self):
        """
		This method tests :meth:`foundations.parsers.SectionsFileParser.attributeExists` method.
		"""

        for type, file in STANDARD_FILES.iteritems():
            sectionsFileParser = SectionsFileParser(file)
            sectionsFileParser.read() and sectionsFileParser.parse(
                False, rawSections=STANDARD_FILES_RAW_SECTIONS[type])
            for attribute in RANDOM_ATTRIBUTES[type]:
                self.assertTrue(
                    sectionsFileParser.attributeExists(
                        attribute,
                        foundations.namespace.getNamespace(attribute,
                                                           rootOnly=True)))
                self.assertFalse(
                    sectionsFileParser.attributeExists(
                        "Unknown",
                        foundations.namespace.getNamespace(attribute,
                                                           rootOnly=True)))