ducky/devices
2015-11-29
Parent:b6494e1a499e
ducky/devices/vendor/golang.org/x/net/LICENSE
Set up DeleteDevices in Memstore. Implement the DeleteDevices method for our Memstore, removing the Devices specified by the passed IDs. Also, create a simple test that verifies that when Devices are deleted, only the Devices you intend to delete are actually deleted. Further tests should be written to verify that this extends to ListDevicesByOwner (e.g., deleted devices will not be returned when listing them), CreateDevices (e.g., will not result in an ErrDeviceAlreadyExists error), and UpdateDevice (e.g., will return an ErrDeviceNotFound error after the Device is deleted). But for now, we're confident that it works in the simplest possible case.
| paddy@0 | 1 Copyright (c) 2009 The Go Authors. All rights reserved. |
| paddy@0 | 2 |
| paddy@0 | 3 Redistribution and use in source and binary forms, with or without |
| paddy@0 | 4 modification, are permitted provided that the following conditions are |
| paddy@0 | 5 met: |
| paddy@0 | 6 |
| paddy@0 | 7 * Redistributions of source code must retain the above copyright |
| paddy@0 | 8 notice, this list of conditions and the following disclaimer. |
| paddy@0 | 9 * Redistributions in binary form must reproduce the above |
| paddy@0 | 10 copyright notice, this list of conditions and the following disclaimer |
| paddy@0 | 11 in the documentation and/or other materials provided with the |
| paddy@0 | 12 distribution. |
| paddy@0 | 13 * Neither the name of Google Inc. nor the names of its |
| paddy@0 | 14 contributors may be used to endorse or promote products derived from |
| paddy@0 | 15 this software without specific prior written permission. |
| paddy@0 | 16 |
| paddy@0 | 17 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| paddy@0 | 18 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| paddy@0 | 19 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| paddy@0 | 20 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| paddy@0 | 21 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| paddy@0 | 22 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| paddy@0 | 23 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| paddy@0 | 24 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| paddy@0 | 25 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| paddy@0 | 26 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| paddy@0 | 27 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |