test:update util tests and remove a line

This commit is contained in:
Slug-Boi
2024-10-25 13:54:41 +02:00
parent def99f602f
commit 6c96fc90bd
2 changed files with 22 additions and 1 deletions
-1
View File
@@ -33,7 +33,6 @@ type item string
var selected = map[string]item{}
var negation = false
var ignore = false
var dupProtect = map[string]string{}
+22
View File
@@ -54,6 +54,7 @@ func Test_DeleteAuthor(t *testing.T) {
t.Errorf("DeleteOneAuthor() did not delete author")
}
}
// Author tests END
// User tests BEGIN
@@ -79,6 +80,27 @@ func Test_RemoveUser(t *testing.T) {
t.Errorf("RemoveUser() = %v; want 3", len(utils.Users))
}
}
func Test_TempAddUser(t *testing.T) {
setup()
defer teardown()
// Test TempAddUser
utils.Define_users("author_file_test")
if len(utils.Users) != 4 {
t.Errorf("Define_users() = %v; want 4", len(utils.Users))
}
utils.TempAddUser("temp", "temp@test.io")
if len(utils.Users) != 5 {
t.Errorf("TempAddUser() = %v; want 5", len(utils.Users))
}
if _, ok := utils.Users["temp"]; !ok {
t.Errorf("TempAddUser() did not add user")
}
}
// User tests END
// Commit tests BEGIN