Added unit tests, renamed to follow absolute importing guidelines, and made minor...
[invirt/packages/python-jsonrpclib.git] / jsonrpclib / history.py
index ec53235..e6a01cf 100644 (file)
@@ -8,6 +8,13 @@ class History(object):
     """
     requests = []
     responses = []
+    _instance = None
+    
+    @classmethod
+    def instance(cls):
+        if not cls._instance:
+            cls._instance = cls()
+        return cls._instance
 
     def add_response(self, response_obj):
         self.responses.append(response_obj)
@@ -32,5 +39,3 @@ class History(object):
     def clear(self):
         del self.requests[:]
         del self.responses[:]
-
-history = History()