Ejemplo n.º 1
0
 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"
     )
Ejemplo n.º 2
0
    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")
Ejemplo n.º 3
0
    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)
Ejemplo n.º 4
0
    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)