def METHOD_NAME(self, html, expected):
    with mock.patch('urllib.request.urlopen') as urlopen:
        urlopen().read.return_value = html
        got = what_if_I_upgrade(conn, pkg)
        self.assertEqual(got, expected)