func (db *MockDB) GetAnalysis(analysisID int) (*Analysis, error) {
	return nil, nil
}
GetAnalysis implements the DB interface.
package db
import "time"
type MockDB struct {
	installations map[int]GHInstallation  
	err           error
	Tools         []Tool
}
var _ DB = (*MockDB)(nil)
func NewMockDB() *MockDB {
	return &MockDB{
		installations: make(map[int]GHInstallation),
	}
}
func (db *MockDB) ForceError(err error) {
	db.err = err
}
func (db *MockDB) AddGHInstallation(installationID, accountID, senderID int) error {
	db.installations[installationID] = GHInstallation{
		InstallationID: installationID,
		AccountID:      accountID,
		SenderID:       senderID,
	}
	return db.err
}
func (db *MockDB) RemoveGHInstallation(installationID int) error {
	delete(db.installations, installationID)
	return db.err
}
func (db *MockDB) EnableGHInstallation(installationID int) error {
	install := db.installations[installationID]
	install.enabledAt = time.Unix(1, 0)
	db.installations[installationID] = install
	return db.err
}
func (db *MockDB) GetGHInstallation(installationID int) (*GHInstallation, error) {
	if installation, ok := db.installations[installationID]; ok {
		return &installation, db.err
	}
	return nil, db.err
}
func (db *MockDB) ListTools() ([]Tool, error) {
	return db.Tools, nil
}
func (db *MockDB) StartAnalysis(ghInstallationID, repositoryID int, commitFrom, commitTo string, requestNumber int) (*Analysis, error) {
	analysis := NewAnalysis()
	analysis.ID = 99
	analysis.CommitFrom = commitFrom
	analysis.CommitTo = commitTo
	analysis.RequestNumber = requestNumber
	return analysis, nil
}
func (db *MockDB) FinishAnalysis(analysisID int, status AnalysisStatus, analysis *Analysis) error {
	return nil
}