Beispiel #1
0
  def setUp( self ):
    # make an in-memory sqlite database to use during testing
    self.connection = Connection_wrapper( sqlite.connect( ":memory:", detect_types = sqlite.PARSE_DECLTYPES, check_same_thread = False ) )
    self.cache = Stub_cache()
    cursor = self.connection.cursor()
    cursor.execute( Stub_object.sql_create_table() )

    self.database = Database( self.connection, self.cache )
Beispiel #2
0
    def setUp(self):
        # make an in-memory sqlite database to use during testing
        self.connection = Connection_wrapper(
            sqlite.connect(":memory:",
                           detect_types=sqlite.PARSE_DECLTYPES,
                           check_same_thread=False))
        self.cache = Stub_cache()
        cursor = self.connection.cursor()
        cursor.execute(Stub_object.sql_create_table())

        self.database = Database(self.connection, self.cache)
    def setUp(self):
        # make an in-memory sqlite database to use during testing
        self.connection = Connection_wrapper(
            sqlite.connect(":memory:",
                           detect_types=sqlite.PARSE_DECLTYPES,
                           check_same_thread=False))
        self.cache = Stub_cache()
        cursor = self.connection.cursor()
        cursor.execute(Stub_object.sql_create_table())

        self.fake_files = {
        }  # map of fake filename (full path) to fake file contents
        self.database = Database(self.connection, self.cache)
        self.upgrader = Schema_upgrader(self.database,
                                        glob=self.glob,
                                        read_file=self.read_file)