| 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 "io/ioutil" |
| 9 "os" |
| 10 "testing" |
| 11 |
| 12 . "github.com/smartystreets/goconvey/convey" |
| 13 |
| 14 . "github.com/luci/luci-go/common/testing/assertions" |
| 15 ) |
| 16 |
| 17 func TestAcquireExclusiveLock(t *testing.T) { |
| 18 lockDir, err := ioutil.TempDir("", "") |
| 19 if err != nil { |
| 20 t.Error("received error creating temporary testing directory") |
| 21 } |
| 22 defer os.Remove(lockDir) |
| 23 path := lockDir + "test.lock" |
| 24 |
| 25 Convey("AcquireExclusiveLock errors if lock file doesn't exist", t, func
(c C) { |
| 26 So(AcquireExclusiveLock(path), ShouldErrLike, "lock file does no
t exist") |
| 27 }) |
| 28 } |
| OLD | NEW |