예제 #1
0
def create_tables(*args, **kwargs):
    Manager(os.environ["APISTAR_APP"]).create_tables()
예제 #2
0
def drop_tables(*args, **kwargs):
    Manager(os.environ["APISTAR_APP"]).drop_tables()
예제 #3
0
def merge(*args, **kwargs):
    Manager(os.environ["APISTAR_APP"]).merge(kwargs["name"])
예제 #4
0
def create(*args, **kwargs):
    Manager(os.environ["APISTAR_APP"]).create(kwargs["name"], kwargs["module"])
예제 #5
0
def upgrade(*args, **kwargs):
    Manager(os.environ["APISTAR_APP"]).upgrade(kwargs["target"], fake=kwargs["fake"])
예제 #6
0
def downgrade(*args, **kwargs):
    Manager(os.environ["APISTAR_APP"]).downgrade(kwargs["target"])
예제 #7
0
 def test_init_app_object(self, app):
     manager = Manager(app)
     assert manager.app == app
예제 #8
0
def status(*args, **kwargs):
    manager = Manager(os.environ["APISTAR_APP"])
    logger.info(repr(manager))
예제 #9
0
 def test_init_app_without_component(self):
     with pytest.raises(ValueError):
         Manager(App(routes=[]))
예제 #10
0
 def test_init_app_path_wrong_path(self):
     with pytest.raises(ImportError):
         Manager("tests.test_manager:wrong_app")
예제 #11
0
 def test_init_app_path_wrong_format(self):
     with pytest.raises(ImportError):
         Manager("wrong-format")
예제 #12
0
 def test_init_app_path(self):
     manager = Manager("tests.test_manager:app_mock")
     assert manager.app == app_mock
예제 #13
0
 def manager(self, app):
     manager = Manager(app)
     manager.router = Mock()
     manager.component = Mock()
     return manager