1
0
Fork 0
mirror of https://github.com/Luzifer/password.git synced 2024-12-20 21:01:17 +00:00
password/vendor/github.com/tredoe/osutil/user/z_test.go
Knut Ahlers 8af625be60
Fix: Vendor new dependencies
Signed-off-by: Knut Ahlers <knut@ahlers.me>
2017-10-06 22:59:38 +02:00

45 lines
978 B
Go

// Copyright 2012 Jonas mg
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
package user
import "testing"
func TestDelUser(t *testing.T) {
err := DelUser(USER)
if err != nil {
t.Fatal(err)
}
_, err = LookupUser(USER)
if _, ok := err.(NoFoundError); !ok {
t.Error("expected to get error NoFoundError")
}
_, err = LookupShadow(USER)
if _, ok := err.(NoFoundError); !ok {
t.Error("expected to get error NoFoundError")
}
}
func TestDelGroup(t *testing.T) {
err := DelGroup(GROUP)
if err != nil {
t.Fatal(err)
}
_, err = LookupGroup(GROUP)
if _, ok := err.(NoFoundError); !ok {
t.Error("expected to get error NoFoundError")
}
_, err = LookupGShadow(GROUP)
if _, ok := err.(NoFoundError); !ok {
t.Error("expected to get error NoFoundError")
}
}
func TestZ(*testing.T) {
removeTempFiles()
}