You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bloodhound.apache.org by rj...@apache.org on 2014/01/13 00:47:29 UTC

svn commit: r1557631 - /bloodhound/trunk/bloodhound_multiproduct/tests/functional/__init__.py

Author: rjollos
Date: Sun Jan 12 23:47:29 2014
New Revision: 1557631

URL: http://svn.apache.org/r1557631
Log:
0.8dev: Let functional tester cache per-product ticket count. Refs #671, #695.

Patch by Olemis Lang.

Modified:
    bloodhound/trunk/bloodhound_multiproduct/tests/functional/__init__.py

Modified: bloodhound/trunk/bloodhound_multiproduct/tests/functional/__init__.py
URL: http://svn.apache.org/viewvc/bloodhound/trunk/bloodhound_multiproduct/tests/functional/__init__.py?rev=1557631&r1=1557630&r2=1557631&view=diff
==============================================================================
--- bloodhound/trunk/bloodhound_multiproduct/tests/functional/__init__.py (original)
+++ bloodhound/trunk/bloodhound_multiproduct/tests/functional/__init__.py Sun Jan 12 23:47:29 2014
@@ -456,7 +456,7 @@ class BloodhoundFunctionalTester(Functio
         :param skiplogin:   Skip admin user login
         """
         self.url = url
-        self._state = instance_state or dict(ticketcount=0)
+        self._state = instance_state or dict(ticketcount={})
 
         # Connect, and login so we can run tests.
         self.go_to_front()
@@ -468,11 +468,13 @@ class BloodhoundFunctionalTester(Functio
         """Retrieve ticket count from shared instance state.
         Ticket ID sequence is global.
         """
-        return self._state.get('ticketcount', 0)
+        ticketcount_cache = self._state.setdefault('ticketcount', {})
+        return ticketcount_cache.get(self.url, 0)
 
     @ticketcount.setter
     def ticketcount(self, value):
-        self._state['ticketcount'] = value
+        ticketcount_cache = self._state.setdefault('ticketcount', {})
+        ticketcount_cache[self.url] = value
 
     def login(self, username):
         """Login as the given user