Skip to content

Instantly share code, notes, and snippets.

@dwalleck
Created June 12, 2012 18:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dwalleck/2919177 to your computer and use it in GitHub Desktop.
Save dwalleck/2919177 to your computer and use it in GitHub Desktop.
test_data = [...some list of dictionaries with inputs to use and the expected exception ...]
def test_create_servers_negative_input(self):
for data in test_data:
yield self.create_delete_server, test_data, test_data['exception']
def create_delete_server(self, data, expected_exception):
try:
self.servers_client.create_server(data)
except expected_exception:
pass
else:
fail
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment