def setUp(self): # Initialize Environment # my_env.init_loghandler(__name__, "c:\\temp\\log", "warning") self.app = create_app('testing') self.app_ctx = self.app.app_context() self.app_ctx.push() self.ns = neostore.NeoStore()
def setUp(self): # Initialize Environment # Todo: Review why I need to push / pull contexts in setUp - TearDown. self.app = create_app(TestConfig) self.app_ctx = self.app.app_context() self.app_ctx.push() self.ns = neostore.NeoStore() mg.init_graph()
def setUp(self): self.app = create_app('testing') self.app_ctx = self.app.app_context() self.app_ctx.push() db.create_all() self.graph = Graph() self.graph_db_empty() self.client = self.app.test_client(use_cookies=True) User.register('dirk', 'olse') self.test_login()
def setUp(self): # Initialize Environment """ neo4j_params = { 'user': "******", 'password': "******", 'db': "stratenloop15.db" } """ self.app = create_app('testing') self.app_ctx = self.app.app_context() self.app_ctx.push() self.ns = neostore.NeoStore() self.ns.init_graph()
def setUp(self): # Initialize Environment self.app = create_app('testing') self.app_ctx = self.app.app_context() self.app_ctx.push() os.environ['Neo4J_User'] = self.app.config.get('NEO4J_USER') os.environ['Neo4J_Pwd'] = self.app.config.get('NEO4J_PWD') os.environ['Neo4J_Db'] = self.app.config.get('NEO4J_DB') neo4j_params = dict(user=os.environ.get('Neo4J_User'), password=os.environ.get('Neo4J_Pwd'), db=os.environ.get('Neo4J_Db')) # self.ns = models_graph.ns() self.ns = neostore.NeoStore(**neo4j_params) self.ns.init_graph()
""" This procedure will test the classes of the models_graph. """ import datetime import unittest from competition import create_app # Create app before import models_graph. Environment settings for Neo4J are required before import. app = create_app('testing') from competition import models_graph as mg # @unittest.skip("Focus on Coverage") class TestModelGraphClass(unittest.TestCase): def setUp(self): # Initialize Environment # Todo: Review why I need to push / pull contexts in setUp - TearDown. self.app_ctx = app.app_context() self.app_ctx.push() self.ns = mg.get_ns() # self.ns = neostore.NeoStore(**neo4j_params) self.ns.init_graph() # my_env.init_loghandler(__name__, "c:\\temp\\log", "warning") def tearDown(self): self.app_ctx.pop() def test_organization_add(self): nr_nodes = len(self.ns.get_nodes())
import platform from competition import create_app from waitress import serve # Run Application if __name__ == "__main__": env = "development" if platform.node() == "zeegeus": env = "production" app = create_app(env) if env == "development": app.run() else: serve(app, listen='127.0.0.1:18103')
def setUp(self): self.app = create_app('testing') self.app_ctx = self.app.app_context() self.app_ctx.push() self.client = self.app.test_client(use_cookies=True) mg.User().register('dirk', 'olse')
import platform from competition import create_app from waitress import serve # Run Application if __name__ == "__main__": env = "development" if platform.node() == "zeegeus": env = "production" app = create_app(env) if env == "development": app.run() else: serve(app, listen='127.0.0.1:18033')
def setUp(self): self.app = create_app('testing') self.app_ctx = self.app.app_context() self.app_ctx.push() db.create_all()
def setUp(self): # Initialize Environment self.app = create_app(TestConfig) self.app_ctx = self.app.app_context() self.app_ctx.push() self.ns = neostore.NeoStore()
def setUp(self): self.app = create_app(TestConfig) self.app_context = self.app.app_context() self.app_context.push()
from competition import create_app from socket import gethostname, gethostbyname def print_local_ip(): """ Get servers local IP address so it can be accessed inside this network. """ spacer = '-' * 50 local_ip = gethostbyname(gethostname()) print('\n{}\nLocal IP address is: {}\n{}'.format(spacer, local_ip, spacer)) if __name__ == '__main__': print_local_ip() app = create_app('development') app.run(host=app.config['SERVER_HOST'], debug=app.config['DEBUG'])
import os import platform from competition import create_app, lm # Run Application app = create_app() @app.shell_context_processor def make_shell_context(): return dict(app=app, lm=lm)