Update test_utils.py

This commit is contained in:
AK391 2021-10-20 12:33:25 -04:00 committed by GitHub
parent 79a34636f8
commit 86f79bb6d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -45,6 +45,13 @@ class TestUtils(unittest.TestCase):
warnings.simplefilter("always")
version_check()
self.assertEqual(str(w[-1].message), "package URL does not contain version info.")
@mock.patch("requests.post")
def test_error_analytics_doesnt_crash_on_connection_error(self, mock_post):
mock_post.side_effect = ConnectionError()
error_analytics()
if __name__ == '__main__':