def setup(self): self.connection_string = "sqlite:///:memory:" self.series_service = SeriesService( connection_string=self.connection_string, debug=False) engine = self.series_service._session_factory.engine test_util.build_db(engine) self.memory_database = MemoryDatabase() self.memory_database.set_series_service(self.series_service) self.session = self.memory_database.series_service._session_factory.get_session( ) self.series = test_util.add_series_bulk_data(self.session) #assert len(self.series.data_values) == 100 self.edit_service = EditService(1, connection=self.memory_database) """ @pytest.fixture(scope="class", autouse=True) def build_db(self): """ #Builds an empty sqlite (in-memory) database for testing #:return: None """
def setup(self): conn_dict = {'engine': 'sqlite', 'address': ':memory:'} self.sm = ServiceManager(conn_dict=conn_dict) # set up remote Database # self.connection_string = "sqlite:///:memory:" self.series_service = self.sm.get_series_service( ) # SeriesService(connection_string=self.connection_string, debug=False) self.session = self.series_service._session_factory.get_session() engine = self.series_service._session_factory.engine test_util.build_db(engine) self.dvs_size = 100 self.series = test_util.add_series_bulk_data(self.session, dvs_size=self.dvs_size) assert self.series assert len(self.series.data_values) == self.dvs_size self.memory_database = MemoryDatabase() self.memory_database.set_series_service(self.series_service) # self.memory_database.initEditValues(self.series.id) self.app = wx.App() self.frame = wx.Frame(None) self.wizard = wizSave( self.frame, self.sm, self.sm.get_edit_service(self.series.id, self.memory_database))
def setup(self): self.connection_string = "sqlite:///:memory:" self.series_service = SeriesService(connection_string=self.connection_string, debug=False) engine = self.series_service._session_factory.engine test_util.build_db(engine) self.memory_database = MemoryDatabase() self.memory_database.set_series_service(self.series_service) self.session = self.memory_database.series_service._session_factory.get_session() self.series = test_util.add_series_bulk_data(self.session) #assert len(self.series.data_values) == 100 self.edit_service =EditService(1, connection= self.memory_database) """ @pytest.fixture(scope="class", autouse=True) def build_db(self): """ #Builds an empty sqlite (in-memory) database for testing #:return: None """
def setup(self): self.connection_string = "sqlite:///:memory:" self.series_service = SeriesService(connection_string=self.connection_string, debug=False) engine = self.series_service._session_factory.engine test_util.build_db(engine) self.memory_database = MemoryDatabase() self.memory_database.set_series_service(self.series_service) self.session = self.memory_database.series_service._session_factory.get_session() self.series = test_util.add_series_bulk_data(self.session) #assert len(self.series.data_values) == 100 self.edit_service =EditService(1, connection= self.memory_database)
def setup(self): self.connection_string = "sqlite:///:memory:" self.series_service = SeriesService( connection_string=self.connection_string, debug=False) engine = self.series_service._session_factory.engine test_util.build_db(engine) self.memory_database = MemoryDatabase() self.memory_database.set_series_service(self.series_service) self.session = self.memory_database.series_service._session_factory.get_session( ) self.series = test_util.add_series_bulk_data(self.session) #assert len(self.series.data_values) == 100 self.edit_service = EditService(1, connection=self.memory_database)
def setup(self): #set up remote Database self.connection_string = "sqlite:///:memory:" self.series_service = SeriesService(connection_string=self.connection_string, debug=False) self.session = self.series_service._session_factory.get_session() engine = self.series_service._session_factory.engine test_util.build_db(engine) self.dvs_size = 100 self.series = test_util.add_series_bulk_data(self.session, dvs_size=self.dvs_size) assert self.series assert len(self.series.data_values) == self.dvs_size self.memory_database = MemoryDatabase() self.memory_database.set_series_service(self.series_service) self.memory_database.initEditValues(self.series.id) self.app = wx.App() self.frame = wx.Frame(None) self.dataTable = FrmDataTable(self.frame)
def setup(self): conn_dict = {'engine': 'sqlite', 'address': ':memory:'} self.sm = ServiceManager(conn_dict=conn_dict) # set up remote Database # self.connection_string = "sqlite:///:memory:" self.series_service = self.sm.get_series_service() # SeriesService(connection_string=self.connection_string, debug=False) self.session = self.series_service._session_factory.get_session() engine = self.series_service._session_factory.engine test_util.build_db(engine) self.dvs_size = 100 self.series = test_util.add_series_bulk_data(self.session, dvs_size=self.dvs_size) assert self.series assert len(self.series.data_values) == self.dvs_size self.memory_database = MemoryDatabase() self.memory_database.set_series_service(self.series_service) # self.memory_database.initEditValues(self.series.id) self.app = wx.App() self.frame = wx.Frame(None) self.wizard = wizSave(self.frame,self.sm, self.sm.get_edit_service(self.series.id, self.memory_database))
def test_build_series(self): dvs = 100 self.series = test_util.add_series_bulk_data(self.session, dvs_size=dvs) assert self.series assert len(self.series.data_values) == dvs