Example #1
0
	def testFilterValues(self):
		"""
		This method tests :meth:`foundations.parsers.PlistFileParser.filterValues` method.
		"""

		plistFileParser = PlistFileParser(PLIST_FILE)
		plistFileParser.parse()
		self.assertEqual(plistFileParser.filterValues(r"String A"), [PLIST_FILE_CONTENT["String A"]])
		self.assertEqual(sorted(plistFileParser.filterValues(r"String.*")), sorted([PLIST_FILE_CONTENT["String A"],
																	PLIST_FILE_CONTENT["Dictionary A"]["String B"],
																	PLIST_FILE_CONTENT["Dictionary A"]["String C"]]))
		self.assertEqual(plistFileParser.filterValues(r"Date A"), [PLIST_FILE_CONTENT["Date A"]])
Example #2
0
    def testFilterValues(self):
        """
		This method tests :meth:`foundations.parsers.PlistFileParser.filterValues` method.
		"""

        plistFileParser = PlistFileParser(PLIST_FILE)
        plistFileParser.parse()
        self.assertEqual(plistFileParser.filterValues(r"String A"),
                         [PLIST_FILE_CONTENT["String A"]])
        self.assertEqual(
            sorted(plistFileParser.filterValues(r"String.*")),
            sorted([
                PLIST_FILE_CONTENT["String A"],
                PLIST_FILE_CONTENT["Dictionary A"]["String B"],
                PLIST_FILE_CONTENT["Dictionary A"]["String C"]
            ]))
        self.assertEqual(plistFileParser.filterValues(r"Date A"),
                         [PLIST_FILE_CONTENT["Date A"]])