Browse Source

Fix test failures

Toni Fadjukoff 6 years ago
parent
commit
e2f35d1500
1 changed files with 3 additions and 3 deletions
  1. 3 3
      db_test.go

+ 3 - 3
db_test.go View File

54
 
54
 
55
 	panels, err := db.FindAllPanels()
55
 	panels, err := db.FindAllPanels()
56
 	if err != nil {
56
 	if err != nil {
57
-		t.Error("Error while searching for panels")
57
+		t.Error("Error while searching for panels", err)
58
 	}
58
 	}
59
 	if len(panels) != 1 {
59
 	if len(panels) != 1 {
60
 		t.Error("Should have found 1 panel, got", len(panels))
60
 		t.Error("Should have found 1 panel, got", len(panels))
65
 	initTestCase(t)
65
 	initTestCase(t)
66
 
66
 
67
 	playlistEntries, err := db.FindPlaylistBySection("Viikko 07")
67
 	playlistEntries, err := db.FindPlaylistBySection("Viikko 07")
68
-	if err != nil {
69
-		t.Error("Error while searching for playlist")
68
+	if err == nil || err.Error() != "sql: no rows in result set" {
69
+		t.Error("err should be 'sql: no rows in result set'")
70
 	}
70
 	}
71
 	if len(playlistEntries) != 0 {
71
 	if len(playlistEntries) != 0 {
72
 		t.Error("Should have found 0 playlistEntries, got", len(playlistEntries))
72
 		t.Error("Should have found 0 playlistEntries, got", len(playlistEntries))