def test_pick_related_subsidiary(self): self.assertEqual( pick_company_for_brand( {'Sealy'}, {'Tempur'}, {'Sealy': 1, 'Tempur-Pedic': 1, 'Tempur Sealy': 0}), 'Tempur-Pedic')
def test_pick_deepest_company(self): self.assertEqual( pick_company_for_brand( {'Rose Art', 'MEGA Brands'}, {'Rose Art'}, {'MEGA Brands': 1, 'Mattel': 0}), 'MEGA Brands')
def test_dont_pick_unrelated_subsidiary(self): self.assertEqual( pick_company_for_brand( {'Unilever'}, {'Dove'}, {'Unilever': 0, "Ben & Jerry's": 1}), 'Unilever')
def test_one(self): self.assertEqual( pick_company_for_brand( {'Clorox'}, {'Liquid-Plumr'}, {'Clorox': 0}), 'Clorox')