Created
April 24, 2012 20:44
-
-
Save rhelmer/2483570 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def test_execute_postgres_with_acceptable_errors(self): | |
| config_manager = self._setup_config_manager() | |
| with config_manager.context() as config: | |
| with setupdb_app.PostgreSQLManager('postgres') as db: | |
| db.execute('CREATE DATABASE blah', ['not so good things']) | |
| calls = self.psycopg2.mock_calls | |
| self.assertEqual(calls[1], mock.call().set_isolation_level(0)) | |
| self.assertEqual(calls[2], mock.call().cursor()) | |
| self.assertEqual(calls[3], mock.call().cursor() | |
| .execute('CREATE DATABASE blah')) | |
| mock.call().throw(psycopg2.ProgrammingError('ERROR: very bad things')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment