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