~nskaggs/+junk/xenial-test

« back to all changes in this revision

Viewing changes to src/github.com/juju/juju/mongo/export_test.go

  • Committer: Nicholas Skaggs
  • Date: 2016-10-24 20:56:05 UTC
  • Revision ID: nicholas.skaggs@canonical.com-20161024205605-z8lta0uvuhtxwzwl
Initi with beta15

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
}