def test_downloading_users_information(self, mock_open): """ Test downloading xml file from http location to file. """ mock_open.return_value = open(XML_URL) data = utils.download_users_information() self.assertTrue(data)
def test_downloading_users_information_key_error(self): """ Test catching io exception during downloading xml file. """ main.app.config.pop('XML_URL') self.assertFalse(utils.download_users_information())
def test_downloading_users_information_catch_error(self, mock_requests): """ Test catching io exception during downloading xml file. """ mock_requests.return_value = '' self.assertFalse(utils.download_users_information())