def testYearEqualsMalePlusFemale(self): for year in t.extract_years(self._stat): alls = t.extract_year(self._stat, year) males = t.extract_year_male(self._stat, year) females = t.extract_year_female(self._stat, year) self.assertEqual(len(alls), len(males) + len(females)) self.assertSubSequence(males, alls) self.assertSubSequence(females, alls)
def testExtractYearFemale_CorrectOrder(self): for year in t.extract_years(self._stat): self.assertHasOrder(t.extract_year_female(self._stat, year), func=self._cmp)
def testExtractYearFemale_CorrectType(self): for year in t.extract_years(self._stat): for item in t.extract_year_female(self._stat, year): self._check_type(item)
def testExtractYears(self): self.assertListEqual(t.extract_years(self._stat), list(map(str, range(2004, 2013))))