Compare commits
2 Commits
8751c4f5bd
...
3d409a7a59
Author | SHA1 | Date | |
---|---|---|---|
3d409a7a59 | |||
22047ba703 |
@ -10,7 +10,6 @@ import (
|
||||
"git.defalsify.org/vise.git/logging"
|
||||
"git.defalsify.org/vise.git/resource"
|
||||
"git.grassecon.net/urdt/ussd/internal/handlers"
|
||||
"git.grassecon.net/urdt/ussd/internal/handlers/server"
|
||||
"git.grassecon.net/urdt/ussd/internal/storage"
|
||||
testdataloader "github.com/peteole/testdata-loader"
|
||||
)
|
||||
@ -22,7 +21,7 @@ var (
|
||||
)
|
||||
|
||||
func TestEngine(sessionId string) (engine.Engine, func()) {
|
||||
var accountService server.AccountServiceInterface
|
||||
//var accountService server.AccountServiceInterface
|
||||
ctx := context.Background()
|
||||
ctx = context.WithValue(ctx, "SessionId", sessionId)
|
||||
pfp := path.Join(scriptDir, "pp.csv")
|
||||
@ -76,13 +75,7 @@ func TestEngine(sessionId string) (engine.Engine, func()) {
|
||||
fmt.Fprintf(os.Stderr, err.Error())
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
if OnlineTestEnabled {
|
||||
accountService = &server.AccountService{}
|
||||
} else {
|
||||
accountService = &server.MockAccountService{}
|
||||
}
|
||||
hl, err := lhs.GetHandler(accountService)
|
||||
hl, err := lhs.GetHandler(AccountService)
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, err.Error())
|
||||
os.Exit(1)
|
||||
|
@ -2,4 +2,12 @@
|
||||
|
||||
package testutil
|
||||
|
||||
const OnlineTestEnabled = false
|
||||
import (
|
||||
"git.grassecon.net/urdt/ussd/internal/handlers/server"
|
||||
)
|
||||
|
||||
var AccountService server.AccountServiceInterface
|
||||
|
||||
func init() {
|
||||
AccountService = &server.MockAccountService{}
|
||||
}
|
||||
|
@ -2,4 +2,14 @@
|
||||
|
||||
package testutil
|
||||
|
||||
const OnlineTestEnabled = true
|
||||
const OnlineTestEnabled = true
|
||||
|
||||
|
||||
|
||||
|
||||
var AccountService server.AccountServiceInterface
|
||||
|
||||
|
||||
func init() {
|
||||
AccountService = &server.AccountService{}
|
||||
}
|
@ -18,4 +18,4 @@ INCMP select_gender 3
|
||||
INCMP enter_yob 4
|
||||
INCMP enter_location 5
|
||||
INCMP enter_offerings 6
|
||||
INCMP view_profile 7
|
||||
INCMP view_profile 7
|
Loading…
Reference in New Issue
Block a user