def test_compare_profiles_not_shared(self): '''Normalizing with one profile containing not_shared and one without''' result = compare_profiles(self.not_shared_profiles) exresult = {'taxa1': 0.10, 'taxa2': 0.30, 'taxa3': 0.15, 'taxa4': 0.25, 'not_shared': 0.20} #make sure the keys in each are the same self.assertEquals(set(result.keys()), set(exresult.keys())) #make sure the values are correct-ish for key in result: self.assertAlmostEquals(result[key], exresult[key])
def test_compare_profiles(self): ''' Comparing three profiles, testing when each are the min and when one \ taxa is equal ''' result = compare_profiles(self.many_profiles) exresult = {'taxa1': 0.10, 'taxa2': 0.22, 'taxa3': 0.15, 'taxa4': 0.25, 'not_shared': 0.28} #make sure the keys in each are the same self.assertEquals(set(result.keys()), set(exresult.keys())) #make sure the values are correct-ish for key in result: self.assertAlmostEquals(result[key], exresult[key])