def test_how_many_namefellows_only_one(self): params = (["Natasha", "Steve", "Ultron", "Rocket"], "Natasha") result = 1 self.assertIs( how_many_namefellows(*params), result, msg="The namefellow count is incorrect" )
def test_how_many_namefellows_person_not_in_queue(self): params = (["Natasha", "Steve", "Ultron", "Natasha", "Rocket"], "Bucky") result = 0 self.assertIs(how_many_namefellows(*params), result, msg="The namefellow count is incorrect")
def test_how_many_namefellows(self): data = [ ((['Natasha', 'Steve', 'Ultron', 'Natasha', 'Rocket'], 'Bucky'), 0), ((['Natasha', 'Steve', 'Ultron', 'Rocket'], 'Natasha'), 1), ((['Natasha', 'Steve', 'Ultron', 'Natasha', 'Rocket'], 'Natasha'), 2), ] error_message = 'The namefellow count is incorrect.' for variant, (params, result) in enumerate(data, start=1): with self.subTest(f'variation #{variant}', input=params, output=result): self.assertIs(how_many_namefellows(*params), result, msg=error_message)
def test_how_many_namefellows(self): data = [ ((["Natasha", "Steve", "Ultron", "Natasha", "Rocket"], "Bucky"), 0), ((["Natasha", "Steve", "Ultron", "Rocket"], "Natasha"), 1), ((["Natasha", "Steve", "Ultron", "Natasha", "Rocket"], "Natasha"), 2), ] error_message = "The namefellow count is incorrect." for variant, (params, result) in enumerate(data, start=1): with self.subTest(f"variation #{variant}", input=params, output=result): self.assertIs(how_many_namefellows(*params), result, msg=error_message)