class TestInputReceiverFactory:
    
    def setup_method(self, method):
        configFile = "settings.cfg"
        self.config = Config( configFile )
        
        queue = Queue.Queue(maxsize=0)
        self.factory = InputReceiverFactory(queue, self.config)
            
    def test_createKeyboard_simple(self):
        receiver = self.factory.createKeyboard()
        assert receiver.__class__ == KeyboardReceiver
        assert receiver.config == self.config.Keyboard
    
    def test_createSocket_simple(self):
        receiver = self.factory.createSocket()
        assert receiver.__class__ == SocketReceiver
        assert receiver.config == self.config.Sockets.Simple
            
    def teardown_method(self, method):
        del self.config
        del self.factory
#Fake socket client
#Author: Witold Wasilewski 2011

from RoboticFramework.IO.InputReceiver.SocketReceiver import SocketReceiver
import Queue
from RoboticFramework.IO.InputReceiverManager import InputReceiverManager
from RoboticFramework.IO.InputReceiverFactory import InputReceiverFactory
from config import Config

configFile = "../../settings.cfg"
config = Config( configFile )
queue = Queue.Queue(maxsize=config.queueMaxSize)
inputReceiversManager = InputReceiverManager()
inputReceiversFactory = InputReceiverFactory(queue, config)

inputReceiversManager.add(inputReceiversFactory.createSocket())

inputReceiversManager.start()

raw_input("Press Enter to continue...")
 def setup_method(self, method):
     configFile = "settings.cfg"
     self.config = Config( configFile )
     
     queue = Queue.Queue(maxsize=0)
     self.factory = InputReceiverFactory(queue, self.config)