Ejemplo n.º 1
0
 def test_choose_host_raises_exception(self):
     service = mock.Mock()
     service.get_hosts.return_value = []
     with pytest.raises(NoHostsAvailableException):
         ServiceCaller.choose_host(service)
Ejemplo n.º 2
0
 def test_choose_host(self):
     hosts = ['foo', 'bar', 'baz']
     service = mock.Mock()
     service.get_hosts.return_value = hosts
     assert ServiceCaller.choose_host(service) in hosts