예제 #1
0
    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
        """
예제 #2
0
 def setup(self):
     self.connection_string = "sqlite:///:memory:"
     session_factory = SessionFactory(self.connection_string, echo=False)
     test_util.build_db(session_factory.engine)
     self.session = session_factory.get_session()
     self.series = test_util.add_series(self.session)
     self.data_values = self.series.data_values
예제 #3
0
 def setup(self):
     self.connection_string = "sqlite:///:memory:"
     session_factory = SessionFactory(self.connection_string, echo=False)
     test_util.build_db(session_factory.engine)
     self.session = session_factory.get_session()
     self.series = test_util.add_series(self.session)
     self.data_values = self.series.data_values
예제 #4
0
    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))
예제 #5
0
    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
        """
예제 #6
0
 def setup(self):
     self.connection_string = "sqlite:///:memory:"
     self.series_service = SeriesService(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)
예제 #7
0
    def setup(self):
        self.connection_string = "sqlite:///:memory:"
        self.session_factory = SessionFactory(self.connection_string, echo=False)
        self.session = self.session_factory.get_session()

        self.series_service = SeriesService(connection_string=self.connection_string)
        engine = self.session_factory.engine
        test_util.build_db(engine)
예제 #8
0
    def setup(self):
        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.series = test_util.add_series(self.session)

        self.memory_db = MemoryDatabase(self.series_service)
예제 #9
0
 def setup(self):
     self.connection_string = "sqlite:///:memory:"
     self.series_service = SeriesService(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)
     """
     @pytest.fixture(scope="class", autouse=True)
 def build_db(self):
     """
     #Builds an empty sqlite (in-memory) database for testing
     #:return: None
     """
예제 #10
0
    def setup(self):
        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.memory_db = MemoryDatabase()

        self.memory_db.set_series_service(self.series_service)
        self.series = test_util.add_series(self.session)
        self.memory_db.initEditValues(self.series.id)
예제 #11
0
    def setup(self):
        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.memory_db = MemoryDatabase()

        self.memory_db.set_series_service(self.series_service)
        self.series = test_util.add_series(self.session)
        self.memory_db.initEditValues(self.series.id)
        sorted_df = sorted(self.memory_db.df['LocalDateTime'])
        self.sdate = sorted_df[0]
예제 #12
0
 def setup(self):
     self.connection_string = "sqlite:///:memory:"
     self.series_service = SeriesService(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)
     """
     @pytest.fixture(scope="class", autouse=True)
 def build_db(self):
     """
     #Builds an empty sqlite (in-memory) database for testing
     #:return: None
     """
예제 #13
0
    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)
예제 #14
0
    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)
예제 #15
0
    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)
예제 #16
0
    def setup(self):
        self.app = wx.App()
        self.frame = wx.Frame(None)
        self.pltProb = plotProbability.plotProb(id=wxID_PAGEPROB, name='pltProb',
                                                parent=self.frame, pos=wx.Point(0, 0), size=wx.Size(605, 458),
                                                style=wx.TAB_TRAVERSAL)


        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
        build_db(engine)

        self.memory_db = MemoryDatabase()

        self.memory_db.set_series_service(self.series_service)
        self.series = add_series(self.session)
        print "Series: ", self.series
        self.memory_db.initEditValues(self.series.id)
예제 #17
0
    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))
예제 #18
0
 def setup(self):
     self.connection_string = "sqlite:///:memory:"
     self.cv_service = CVService(self.connection_string, debug=False)
     self.session = self.cv_service._session_factory.get_session()
     engine = self.cv_service._session_factory.engine
     test_util.build_db(engine)