Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2017 The LUCI Authors. All rights reserved. | |
| 2 // Use of this source code is governed under the Apache License, Version 2.0 | |
| 3 // that can be found in the LICENSE file. | |
| 4 | |
| 5 package lib | |
| 6 | |
| 7 import ( | |
| 8 "fmt" | |
| 9 . "github.com/smartystreets/goconvey/convey" | |
| 10 "io/ioutil" | |
| 11 "os" | |
| 12 "testing" | |
|
iannucci
2017/07/11 20:52:15
imports should be separated basically like:
<st
charliea (OOO until 10-5)
2017/07/11 23:26:16
Done.
| |
| 13 ) | |
| 14 | |
| 15 func TestAcquireExclusiveLock(t *testing.T) { | |
| 16 lockDir, err := ioutil.TempDir("/tmp", "") | |
| 17 if err != nil { | |
| 18 t.Error("received error creating temporary testing directory") | |
| 19 } | |
| 20 defer os.Remove(lockDir) | |
| 21 path := lockDir + ".lock" | |
| 22 | |
| 23 Convey("AcquireExclusiveLock errors if lock file doesn't exist", t, func (c C) { | |
| 24 So(AcquireExclusiveLock(path).Error(), ShouldEqual, fmt.Sprintf( "cannot acquire lock on %s because file does not exist", path)) | |
|
iannucci
2017/07/11 20:52:15
add an import:
. "github.com/luci/luci-go/commo
charliea (OOO until 10-5)
2017/07/11 23:26:16
Done.
| |
| 25 }) | |
| 26 } | |
| OLD | NEW |