def test_get_two_valid_badges_id(self):
        base_url = r'<div class="c-grid-item c-grid-item--stack-lt-sm cr-public-organization-badge-' + \
                   r'template-grid-item" href="/org/{company}/badge/'.format(company=self.company) + \
                   r'{badge_id}">Nothing</div>'
        badges_ids = [
            'hello-world',
            '"></spam class="Nikki-93-Micah',
            'what.eVer.123',
        ]
        urls = [
            'Url #1',
            'Url #2',
            'Url #3',
        ]
        responses = [
            base_url.format(badge_id=badges_ids[0]),
            base_url.format(badge_id=badges_ids[1]),
            base_url.format(badge_id=badges_ids[2]),
        ]
        expected_badges_ids = [
            badges_ids[0],
            badges_ids[2],
        ]

        self.MockGetAllUrls.return_value.get_urls = urls
        self.MockUrllib3_requested.data.decode.side_effect = responses

        get_all = GetAll(self.company)
        get_all._multiprocess = False
        get_all.execute()
        badges_ids = get_all.get_badges_id
        self.assertEqual(expected_badges_ids, badges_ids)
    def test_when_the_data_request_is_invalid(self):
        urls = [
            'Url #1',
            'Url #2',
            'Url #3',
        ]
        expected_calls = [
            call('GET', urls[0]),
            call('GET', urls[1]),
            call('GET', urls[2]),
        ]

        self.MockGetAllUrls.return_value.get_urls = urls
        self.MockUrllib3_requested.data = None

        get_all = GetAll(self.company)
        get_all._multiprocess = False
        get_all.execute()
        self.MockUrllib3_request.assert_has_calls(expected_calls)