load a default fetchFunc for dao.ExpandRecord(s)

This commit is contained in:
Gani Georgiev
2023-07-14 08:36:01 +03:00
parent fdccdcebad
commit 2b465b0646
3 changed files with 39 additions and 21 deletions

View File

@@ -48,15 +48,6 @@ func TestExpandRecords(t *testing.T) {
0,
0,
},
{
"empty fetchFunc",
"demo4",
[]string{"i9naidtvr6qsgb4", "qzaqccwrmva4o1n"},
[]string{"self_rel_one", "self_rel_many.self_rel_one"},
nil,
0,
2,
},
{
"fetchFunc with error",
"demo4",
@@ -101,6 +92,19 @@ func TestExpandRecords(t *testing.T) {
0,
1,
},
{
"with nil fetchfunc",
"users",
[]string{
"bgs820n361vj1qd",
"4q1xlclmfloku33",
"oap640cot4yru2s", // no rels
},
[]string{"rel"},
nil,
2,
0,
},
{
"expand normalizations",
"demo4",
@@ -132,6 +136,19 @@ func TestExpandRecords(t *testing.T) {
2,
0,
},
{
"with nil fetchfunc",
"users",
[]string{
"bgs820n361vj1qd",
"4q1xlclmfloku33",
"oap640cot4yru2s", // no rels
},
[]string{"rel"},
nil,
2,
0,
},
{
"maxExpandDepth reached",
"demo4",
@@ -228,15 +245,6 @@ func TestExpandRecord(t *testing.T) {
0,
0,
},
{
"empty fetchFunc",
"demo4",
"i9naidtvr6qsgb4",
[]string{"self_rel_one", "self_rel_many.self_rel_one"},
nil,
0,
2,
},
{
"fetchFunc with error",
"demo4",