package orm

import "testing"

func TestOrm(t *testing.T) {
	testConfig := map[string]interface{}{
		"connection_string": "test_data/db/empty_test.db",
		"driver":            "sqlite3",
	}
	emptyDeps := make(map[string]interface{})

	t.Run("Init", func(t *testing.T) {
		_, err := Init(emptyDeps, testConfig)
		if err != nil {
			t.Errorf("Encountered an error: %s", err.Error())
		}
	})
}

package orm

import "testing"
import "github.com/mattn/go-sqlite3"

func TestOrm(t *testing.T) {
	testConfig := map[string]interface{}{
		"connection_string": "test_data/db/empty_test.db",
		"driver":            "sqlite3",
	}
	emptyDeps := make(map[string]interface{})

	t.Run("InitInvalidConf", func(t *testing.T) {
		conf := testConfig
		conf["connection_string"] = "test_data/db/not_exist.db"
		_, err := Init(emptyDeps, conf)
		if err == nil {
			t.Errorf("Invalid conf unexpectedly did not return an error.")
		}
		switch err.(type) {
		case sqlite3.Error:
			return
		}
		t.Errorf("Unexpected error: " + err.Error())
	})
}

Change orm test to make it pass
Change orm test to make it pass

This makes it purposely use invalid data and expect an error. When we
have a better plan for testing database-related functionality, we can
add tests that use valid data.
