aboutsummaryrefslogtreecommitdiffstats
path: root/graphql
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2019-05-27 21:14:55 +0200
committerMichael Muré <batolettre@gmail.com>2019-05-27 21:14:55 +0200
commitc7abac388aadd274d4f23f996a15f8bba90f2a92 (patch)
treeced1116de500346eb340f72b7bfc672136e40c1e /graphql
parent9865dfcdf0810e288283f2ef4eba450041db32f9 (diff)
downloadgit-bug-c7abac388aadd274d4f23f996a15f8bba90f2a92.tar.gz
repo: refactor how test repo are created/cleaned
Diffstat (limited to 'graphql')
-rw-r--r--graphql/graphql_test.go18
1 files changed, 4 insertions, 14 deletions
diff --git a/graphql/graphql_test.go b/graphql/graphql_test.go
index f8a3c059..6784df96 100644
--- a/graphql/graphql_test.go
+++ b/graphql/graphql_test.go
@@ -9,23 +9,13 @@ import (
"github.com/MichaelMure/git-bug/graphql/models"
"github.com/MichaelMure/git-bug/misc/random_bugs"
"github.com/MichaelMure/git-bug/repository"
- "github.com/MichaelMure/git-bug/util/test"
)
-func CreateFilledRepo(bugNumber int) repository.ClockedRepo {
- repo := test.CreateRepo(false)
-
- var seed int64 = 42
- options := random_bugs.DefaultOptions()
-
- options.BugNumber = bugNumber
-
- random_bugs.CommitRandomBugsWithSeed(repo, options, seed)
- return repo
-}
-
func TestQueries(t *testing.T) {
- repo := CreateFilledRepo(10)
+ repo := repository.CreateTestRepo(false)
+ defer repository.CleanupTestRepos(t, repo)
+
+ random_bugs.FillRepoWithSeed(repo, 10, 42)
handler, err := NewHandler(repo)
if err != nil {