test(GODT-3220): Create function for getting the test user by address
GODT-3220
This commit is contained in:
parent
7fa1948c21
commit
0ca07066db
|
@ -290,6 +290,18 @@ func (t *testCtx) getUserByID(userID string) *testUser {
|
||||||
return t.userByID[userID]
|
return t.userByID[userID]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (t *testCtx) getUserByAddress(email string) *testUser {
|
||||||
|
for _, user := range t.userByID {
|
||||||
|
for _, addr := range user.addresses {
|
||||||
|
if addr.email == email {
|
||||||
|
return user
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
panic(fmt.Sprintf("unknown email %q", email))
|
||||||
|
}
|
||||||
|
|
||||||
func (t *testCtx) getMBoxID(userID string, name string) string {
|
func (t *testCtx) getMBoxID(userID string, name string) string {
|
||||||
ctx, cancel := context.WithCancel(context.Background())
|
ctx, cancel := context.WithCancel(context.Background())
|
||||||
defer cancel()
|
defer cancel()
|
||||||
|
|
Loading…
Reference in New Issue