def create_tables(*args, **kwargs): Manager(os.environ["APISTAR_APP"]).create_tables()
def drop_tables(*args, **kwargs): Manager(os.environ["APISTAR_APP"]).drop_tables()
def merge(*args, **kwargs): Manager(os.environ["APISTAR_APP"]).merge(kwargs["name"])
def create(*args, **kwargs): Manager(os.environ["APISTAR_APP"]).create(kwargs["name"], kwargs["module"])
def upgrade(*args, **kwargs): Manager(os.environ["APISTAR_APP"]).upgrade(kwargs["target"], fake=kwargs["fake"])
def downgrade(*args, **kwargs): Manager(os.environ["APISTAR_APP"]).downgrade(kwargs["target"])
def test_init_app_object(self, app): manager = Manager(app) assert manager.app == app
def status(*args, **kwargs): manager = Manager(os.environ["APISTAR_APP"]) logger.info(repr(manager))
def test_init_app_without_component(self): with pytest.raises(ValueError): Manager(App(routes=[]))
def test_init_app_path_wrong_path(self): with pytest.raises(ImportError): Manager("tests.test_manager:wrong_app")
def test_init_app_path_wrong_format(self): with pytest.raises(ImportError): Manager("wrong-format")
def test_init_app_path(self): manager = Manager("tests.test_manager:app_mock") assert manager.app == app_mock
def manager(self, app): manager = Manager(app) manager.router = Mock() manager.component = Mock() return manager