1. John Chandler
  2. django-fluidproxy

Commits

John Chandler  committed f0e166b

Added tests and code for get() method, using cached values

  • Participants
  • Parent commits 7be8594
  • Branches default

Comments (0)

Files changed (2)

File django_fluidproxy.py

View file
             raise TypeError( "Argument fluid requires Fluid session object" )
         self.fluid = fluid
 
+    def get( self, path ):
+        """ Make a proxied FluidDB API call """
+        return cache.get( generate_cache_key(path) )
+
     def preload( self, path, value=None ):
         """ Preload proxy cache
             path  = FluidDB path e.g. /path/to/tag

File tests.py

View file
         self.proxy.unload( "/metaljoe/test/foo" )
 
         self.assertEqual( cache.get(key), None )
+
+    def test_get_path( self ):
+        """ Tests retrieving a simple, cached path """
+        path  = "/metaljoe/test/foo"
+        value = 1234
+        
+        self.proxy.preload( path, value=value )
+
+        self.assertEqual( self.proxy.get(path), value )
         
 
 if __name__ == "__main__":