def test_get_rabbitmq_location(self): flexmock(file_io) \ .should_receive("read").and_return("192.168.0.1") flexmock(file_io) \ .should_receive("write").and_return(None) expected = "amqp://*****:*****@192.168.0.1:5672//" self.assertEquals(rabbitmq.get_connection_string(), expected)
from appscale.taskqueue.tq_lib import TASK_STATES from google.appengine.runtime import apiproxy_errors from google.appengine.api import apiproxy_stub_map from google.appengine.api import datastore_errors from google.appengine.api import datastore_distributed from google.appengine.api import datastore from google.appengine.ext import db sys.path.append(TaskQueueConfig.CELERY_CONFIG_DIR) sys.path.append(TaskQueueConfig.CELERY_WORKER_DIR) app_id = 'APP_ID' module_name = TaskQueueConfig.get_celery_worker_module_name(app_id) celery = Celery(module_name, broker=rabbitmq.get_connection_string(), backend='amqp://') celery.config_from_object('CELERY_CONFIGURATION') logger = get_task_logger(__name__) master_db_ip = appscale_info.get_db_master_ip() connection_str = master_db_ip + ":" + str(constants.DB_SERVER_PORT) ds_distrib = datastore_distributed.DatastoreDistributed( "appscaledashboard", connection_str, require_indexes=False) apiproxy_stub_map.apiproxy.RegisterStub('datastore_v3', ds_distrib) os.environ['APPLICATION_ID'] = "appscaledashboard" # This template header and tasks can be found in appscale/AppTaskQueue/templates
from appscale.taskqueue.tq_lib import TASK_STATES from google.appengine.runtime import apiproxy_errors from google.appengine.api import apiproxy_stub_map from google.appengine.api import datastore_errors from google.appengine.api import datastore_distributed from google.appengine.api import datastore from google.appengine.ext import db sys.path.append(TaskQueueConfig.CELERY_CONFIG_DIR) sys.path.append(TaskQueueConfig.CELERY_WORKER_DIR) app_id = 'APP_ID' module_name = TaskQueueConfig.get_celery_worker_module_name(app_id) celery = Celery(module_name, broker=rabbitmq.get_connection_string(), backend='amqp://') celery.config_from_object('CELERY_CONFIGURATION') logger = get_task_logger(__name__) logger.setLevel(logging.INFO) db_proxy = appscale_info.get_db_proxy() connection_str = '{}:{}'.format(db_proxy, str(constants.DB_SERVER_PORT)) ds_distrib = datastore_distributed.DatastoreDistributed( "appscaledashboard", connection_str, require_indexes=False) apiproxy_stub_map.apiproxy.RegisterStub('datastore_v3', ds_distrib) os.environ['APPLICATION_ID'] = "appscaledashboard" # This template header and tasks can be found in appscale/AppTaskQueue/templates
def test_get_rabbitmq_location(self): expected = "amqp://*****:*****@localhost:5672//" self.assertEquals(rabbitmq.get_connection_string(), expected)
from google.appengine.runtime import apiproxy_errors from google.appengine.api import apiproxy_stub_map from google.appengine.api import datastore_errors from google.appengine.api import datastore_distributed from google.appengine.api import datastore from google.appengine.ext import db sys.path.append(TaskQueueConfig.CELERY_CONFIG_DIR) sys.path.append(TaskQueueConfig.CELERY_WORKER_DIR) app_id = 'APP_ID' module_name = TaskQueueConfig.get_celery_worker_module_name(app_id) celery = Celery(module_name, broker=rabbitmq.get_connection_string(), backend='amqp://') celery.config_from_object('CELERY_CONFIGURATION') logger = get_task_logger(__name__) master_db_ip = appscale_info.get_db_master_ip() connection_str = master_db_ip + ":" + str(constants.DB_SERVER_PORT) ds_distrib = datastore_distributed.DatastoreDistributed("appscaledashboard", connection_str, require_indexes=False) apiproxy_stub_map.apiproxy.RegisterStub('datastore_v3', ds_distrib) os.environ['APPLICATION_ID'] = "appscaledashboard" # This template header and tasks can be found in appscale/AppTaskQueue/templates