MCPcopy Index your code
hub / github.com/gogs/gogs / usersIsFollowing

Function usersIsFollowing

internal/database/users_test.go:1348–1367  ·  view source on GitHub ↗
(t *testing.T, ctx context.Context, s *UsersStore)

Source from the content-addressed store, hash-verified

1346}
1347
1348func usersIsFollowing(t *testing.T, ctx context.Context, s *UsersStore) {
1349 usersStore := newUsersStore(s.db)
1350 alice, err := usersStore.Create(ctx, "alice", "alice@example.com", CreateUserOptions{})
1351 require.NoError(t, err)
1352 bob, err := usersStore.Create(ctx, "bob", "bob@example.com", CreateUserOptions{})
1353 require.NoError(t, err)
1354
1355 got := s.IsFollowing(ctx, alice.ID, bob.ID)
1356 assert.False(t, got)
1357
1358 err = s.Follow(ctx, alice.ID, bob.ID)
1359 require.NoError(t, err)
1360 got = s.IsFollowing(ctx, alice.ID, bob.ID)
1361 assert.True(t, got)
1362
1363 err = s.Unfollow(ctx, alice.ID, bob.ID)
1364 require.NoError(t, err)
1365 got = s.IsFollowing(ctx, alice.ID, bob.ID)
1366 assert.False(t, got)
1367}
1368
1369func usersUnfollow(t *testing.T, ctx context.Context, s *UsersStore) {
1370 usersStore := newUsersStore(s.db)

Callers

nothing calls this directly

Calls 5

newUsersStoreFunction · 0.85
FollowMethod · 0.80
UnfollowMethod · 0.80
CreateMethod · 0.45
IsFollowingMethod · 0.45

Tested by

no test coverage detected