def setup_db(self):
     self.db_file_path = testdb.create_temp_db_file()
     MockedSettings['db_uri'] = testdb.get_temp_db_uri(self.db_file_path)
     with patch.dict(db.Settings, MockedSettings):
         db.init_db()
         self.insert_checklists()
         yield
         db.finalize_db()
         os.unlink(self.db_file_path)
Beispiel #2
0
 def setup_db(self):
     self.temp_git_dirs = []
     self.db_file = testdb.make_test_db()
     MockedSettings['db_uri'] = testdb.get_temp_db_uri(self.db_file)
     MockedSettings['irc'] = {
         "nickname": "pushhamster+test",
         "channel": "pushmanagertest"
     }
     with mock.patch.dict(db.Settings, MockedSettings):
         db.init_db()
Beispiel #3
0
 def setup_db(self):
     self.temp_git_dirs = []
     self.db_file = testdb.make_test_db()
     MockedSettings['db_uri'] = testdb.get_temp_db_uri(self.db_file)
     MockedSettings['irc'] = {
         "nickname": "pushhamster+test",
         "channel": "pushmanagertest"
     }
     with mock.patch.dict(db.Settings, MockedSettings):
         db.init_db()
Beispiel #4
0
    def setup_db(self):
        self.setup_async_test_case()

        self.db_file = testdb.make_test_db()
        MockedSettings['db_uri'] = testdb.get_temp_db_uri(self.db_file)
        MockedSettings['irc'] = {
            "nickname": "pushhamster+test",
            "channel": "pushmanagertest"
        }
        # for the purpose of unittests we'll use a single application
        # for API and main site.
        MockedSettings['api_app'] = {
            "domain": "localhost",
            "port": self.get_http_port()
        }

        with mock.patch.dict(db.Settings, MockedSettings):
            db.init_db()
Beispiel #5
0
 def setup_db_settings(self):
     self.db_file_path = testdb.create_temp_db_file()
     MockedSettings['db_uri'] = testdb.get_temp_db_uri(self.db_file_path)
     with mock.patch.dict(db.Settings, MockedSettings):
         db.init_db()
         self.populate_database()