This commit is contained in:
kolaente 2018-07-27 15:53:01 +02:00
parent 628f3eee64
commit 62ac4c2a74
No known key found for this signature in database
GPG key ID: F40E70337AB24C9B
2 changed files with 6 additions and 6 deletions

View file

@ -1,9 +1,9 @@
package models package models
import ( import (
"testing"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"reflect" "reflect"
"testing"
) )
func TestList_ReadAll(t *testing.T) { func TestList_ReadAll(t *testing.T) {
@ -27,7 +27,7 @@ func TestList_ReadAll(t *testing.T) {
assert.Equal(t, s.Len(), 1) assert.Equal(t, s.Len(), 1)
// Try getting lists for a nonexistant user // Try getting lists for a nonexistant user
_, err = lists2.ReadAll(&User{ID:984234}) _, err = lists2.ReadAll(&User{ID: 984234})
assert.Error(t, err) assert.Error(t, err)
assert.True(t, IsErrUserDoesNotExist(err)) assert.True(t, IsErrUserDoesNotExist(err))
} }

View file

@ -1,9 +1,9 @@
package models package models
import ( import (
"testing"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"reflect" "reflect"
"testing"
) )
func TestNamespace_Create(t *testing.T) { func TestNamespace_Create(t *testing.T) {
@ -12,7 +12,7 @@ func TestNamespace_Create(t *testing.T) {
// Dummy namespace // Dummy namespace
dummynamespace := Namespace{ dummynamespace := Namespace{
Name:"Test", Name: "Test",
Description: "Lorem Ipsum", Description: "Lorem Ipsum",
} }
@ -27,7 +27,7 @@ func TestNamespace_Create(t *testing.T) {
// check if it really exists // check if it really exists
assert.True(t, dummynamespace.CanRead(&doer)) assert.True(t, dummynamespace.CanRead(&doer))
newOne := Namespace{ID:dummynamespace.ID} newOne := Namespace{ID: dummynamespace.ID}
err = newOne.ReadOne() err = newOne.ReadOne()
assert.NoError(t, err) assert.NoError(t, err)
assert.Equal(t, newOne.Name, "Test") assert.Equal(t, newOne.Name, "Test")
@ -63,7 +63,7 @@ func TestNamespace_Create(t *testing.T) {
assert.True(t, IsErrNamespaceNameCannotBeEmpty(err)) assert.True(t, IsErrNamespaceNameCannotBeEmpty(err))
// Try updating a nonexistant one // Try updating a nonexistant one
n := Namespace{ID:284729, Name:"Lorem"} n := Namespace{ID: 284729, Name: "Lorem"}
err = n.Update() err = n.Update()
assert.Error(t, err) assert.Error(t, err)
assert.True(t, IsErrNamespaceDoesNotExist(err)) assert.True(t, IsErrNamespaceDoesNotExist(err))