github.com/axw/juju@v0.0.0-20161005053422-4bd6544d08d4/mongo/export_test.go (about) 1 // Copyright 2014 Canonical Ltd. 2 // Licensed under the AGPLv3, see LICENCE file for details. 3 4 package mongo 5 6 import ( 7 "github.com/juju/juju/service/common" 8 svctesting "github.com/juju/juju/service/common/testing" 9 ) 10 11 var ( 12 MakeJournalDirs = makeJournalDirs 13 MongoConfigPath = &mongoConfigPath 14 15 SharedSecretPath = sharedSecretPath 16 SSLKeyPath = sslKeyPath 17 18 NewConf = newConf 19 20 HostWordSize = &hostWordSize 21 RuntimeGOOS = &runtimeGOOS 22 AvailSpace = &availSpace 23 MinOplogSizeMB = &minOplogSizeMB 24 PreallocFile = &preallocFile 25 26 DefaultOplogSize = defaultOplogSize 27 FsAvailSpace = fsAvailSpace 28 PreallocFileSizes = preallocFileSizes 29 PreallocFiles = preallocFiles 30 ) 31 32 func PatchService(patchValue func(interface{}, interface{}), data *svctesting.FakeServiceData) { 33 patchValue(&discoverService, func(name string) (mongoService, error) { 34 svc := svctesting.NewFakeService(name, common.Conf{}) 35 svc.FakeServiceData = data 36 return svc, nil 37 }) 38 patchValue(&newService, func(name string, conf common.Conf) (mongoService, error) { 39 svc := svctesting.NewFakeService(name, conf) 40 svc.FakeServiceData = data 41 return svc, nil 42 }) 43 }