We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fd88309 commit 516f746Copy full SHA for 516f746
uploader/uploader.go
@@ -31,9 +31,14 @@ import (
31
32
var filesToUpload [3]string = [3]string{"courses.json", "professors.json", "sections.json"}
33
34
+// Wrapped for testability - can be replaced with mock in unit tests
35
+var connectDBFunc = func() *mongo.Client {
36
+ return connectDB()
37
+}
38
+
39
func Upload(inDir string, replace bool, staticOnly bool) {
40
//Connect to mongo
- client := connectDB()
41
+ client := connectDBFunc()
42
43
// Get 5 minute context
44
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)
0 commit comments