I have a function below and want to write a unittest to check if my code catches ConnectionError using mock library 

```
def get_foo():
    try:
        return requests.get("http://www.bongani.com")
    except requests.exceptions.ConnectionError:
        print("Error")

```

What I have:

```
import unittest
import mock

class MyTestCase(unittest.TestCase):
    @mock.patch('requests.get')
    def test_foo(self, mock_requests_get):
        mock_requests_get.side_effect = requests.exceptions.ConnectionError()
        with self.assertRaises(requests.exceptions.ConnectionError):
            get_foo()

if __name__ == '__main__':
    unittest.main()

```

I get this error:

```
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/mock/mock.py", line 1305 , in patched
  return func(*args, **keywargs)
File "<ipython-input-24-15266e4f708a>", , in test_foo
  get_foo()
AssertionError: ConnectionError not raised

```

I want to mock the `return requests.get("http://www.bongani.com")` line so that it raises an exception when called