import unittest

import delighted


class ClientTest(unittest.TestCase):

    def test_instantiating_client_requires_api_key(self):
        self.assertRaises(ValueError, lambda: delighted.Client())
        delighted.Client(api_key='abc123')

@@ -125,16 +125,115 @@
 (self):%0A
+        original_api_key = delighted.api_key%0A        try:%0A            delighted.api_key = None%0A    
         
@@ -290,32 +290,36 @@
 ient())%0A        
+    
 delighted.Client
@@ -337,8 +337,73 @@
 bc123')%0A
+        except:%0A            delighted.api_key = original_api_key%0A

Make no-api-key test more reliable