Esempio n. 1
0
    def test_get_all(self):
        configuration = ConfigurationComponent()
        repository = UsersRepository(configuration)
        user = UserEntity("cambio")
        repository.create(user)

        data = UserEntity.query.all()

        frame = repository.list()
        data = frame.to_dict()
        self.assertTrue(data)
        frame = repository.get_one(data[0]["user_id"])
        data = frame.to_dict()
        repository.delete_one(data[0]["user_id"])
        self.assertTrue(data)
    def __init__(self, configuration: ConfigurationComponent):

        self.configuration = configuration
        client_proxies = dict()
        if configuration.get_falcon_http_proxy():
            client_proxies["http"] = self.configuration.get_falcon_http_proxy()
        if self.configuration.get_falcon_https_proxy():
            client_proxies[
                "https"] = self.configuration.get_falcon_https_proxy()

        if self.configuration.get_slack_key(
        ) and self.configuration.get_slack_key() != "console":
            self.sc = SlackClient(self.configuration.get_slack_key(),
                                  proxies=client_proxies)
        else:
            self.sc = ConsoleClient()
def get_notifications():
    configuration = ConfigurationComponent()
    result = configuration.diagnostics()
    return make_response(result, 200)
 def __init__(self):
     self.slack_gateway = SlackGateway(ConfigurationComponent())
Esempio n. 5
0
def home():
    notification = NotificationEntity()
    result = dict()
    result["diagnostic"] = (ConfigurationComponent()).diagnostics()
    result["sample"] = notification.__dict__
    return result
Esempio n. 6
0
from sqlalchemy.orm import scoped_session, sessionmaker
from app.core.QueryEntity import QueryEntity
from app.components.ConfigurationComponent import ConfigurationComponent

#  add reference to register automatic creation

from app.core.UserEntity import UserEntity
from app.core.CustomerEntity import CustomerEntity
from app.core.SubscriptionEntity import SubscriptionEntity
from app.core.SquadEntity import SquadEntity
from app.core.ProductEntity import ProductEntity
from app.core.FeatureEntity import FeatureEntity
from app.core.ServiceEntity import ServiceEntity
from app.core.ServiceFeatureEntity import ServiceFeatureEntity

configuration = ConfigurationComponent()

if configuration.get_environment() == "prod":
    engine = create_engine(configuration.build_db_connection(),
                           convert_unicode=True)
elif configuration.get_environment() == "dev":
    engine = create_engine('sqlite:///dev.db')
    QueryEntity.metadata.create_all(bind=engine)
elif configuration.get_environment() == "manual":
    engine = create_engine('sqlite:///manual.db')
    QueryEntity.metadata.create_all(bind=engine)
else:
    engine = create_engine('sqlite://')
    QueryEntity.metadata.create_all(bind=engine)

db_session = scoped_session(
    def __init__(self,
                 configuration: ConfigurationComponent = None,
                 owlvey: OwlveyGateway = None):

        self.configuration = configuration or ConfigurationComponent()
        self.owlvey = owlvey or OwlveyGateway(self.configuration)
 def test_configuration(self):
     configuration = ConfigurationComponent()
     self.assertEqual("test", configuration.name)
 def setUp(self):
     self.slack = SlackGateway(ConfigurationComponent())