Anonymous avatar Anonymous committed 48a5d47 Draft

updated to work with latest version of araldo; removed warnings

Comments (0)

Files changed (4)

 	${MAKE} test-pytest-quick  
 
 test-pytest-full:
-	py.test --verbose --doctest-modules  --cov ${PACKAGE} --cov-report=html test/
+	py.test --verbose --doctest-modules  --cov ${PACKAGE} --cov-report=html araldo_redis/ test/
 
 test-pytest-quick:
 	py.test --verbose --doctest-modules  test/ 

araldo_redis/__init__.py

 
 VERSION = "0.0.1"
 
+
 def _setup_logging():
     """ Configure logging system
     """

araldo_redis/endpoints/redis_endpoint.py

 from araldo.endpoints import InBoundBase, OutBoundBase, PluginException
 
 
-
 class InBound(InBoundBase):  # pylint: disable-msg=R0904
     """ InBound endpoint implementation for receiving *Redis* messages
     """
             :param config: configuration object
             :param gevent_queue: queue for forwarding incoming messages
         """
-        print ">>>>>>>>>",kwargs
         config = kwargs["config"]
-        gevent_queue = kwargs["gevent_queue"]
         redis_server = kwargs.get("redis_server", None)
-        self._channel_name = config["channel"] 
+        self._channel_name = config["channel"]
         if not redis_server:
             self._server = redis.Redis(
-                host=config["host"], 
+                host=config["host"],
                 port=config["port"])
         else:
             self._server = redis_server
         return "inbound-redis"
 
     def _run(self):  # pylint: disable-msg=E0202
-        """ Enter infinite gevent loop to receive messages from 
+        """ Enter infinite gevent loop to receive messages from
             Redis pubsub queue and push it to gevent queue
         """
         messages = self._client.listen()
             self.gevent_queue.put((self.name(), message))
             gevent.sleep(0)
 
-
     def check(self):
         """ implementation of abstract method
         """
     """ Outound implementation for sending messages via *Redis*
     """
     def __init__(self, **kwargs):
-        name = kwargs["name"]
-        plugin_manager = kwargs["plugin_manager"]
         config = kwargs["config"]
-        self._channel_name = config["channel"] 
+        self._channel_name = config["channel"]
         self._server = redis.Redis(
-            host=config["host"], 
+            host=config["host"],
             port=config["port"])
         OutBoundBase.__init__(self, **kwargs)
 

test/redis_test.py

 
 @pytest.fixture
 def plugin_manager():
-    return Mock()
+    plugin_manager = Mock()
+    marshal_default = Mock()
+    plugin_manager.plugin_instances.return_value = {
+        "araldo.marshalling": {
+            "marshal-default": marshal_default
+        }
+    }
+    return plugin_manager
 
 
 @pytest.fixture
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.