2
0
mirror of https://github.com/carlostrub/sisyphus synced 2024-10-31 09:20:15 +00:00

fix tests

This commit is contained in:
Carlo Strub 2017-06-05 14:13:27 +00:00
parent 9027d8a954
commit 4d2a9f5115
2 changed files with 2 additions and 10 deletions

View File

@ -1,7 +1,6 @@
package sisyphus_test package sisyphus_test
import ( import (
"errors"
"math" "math"
"os" "os"
@ -32,9 +31,6 @@ var _ = Describe("Classify Mails", func() {
Junk: true, Junk: true,
} }
err = m.Load("test/Maildir")
Ω(err).ShouldNot(HaveOccurred())
err = m.Learn(dbs["test/Maildir"], "test/Maildir") err = m.Learn(dbs["test/Maildir"], "test/Maildir")
Ω(err).ShouldNot(HaveOccurred()) Ω(err).ShouldNot(HaveOccurred())
@ -43,9 +39,6 @@ var _ = Describe("Classify Mails", func() {
Key: "1488230510.M141612P8565.mail.carlostrub.ch,S=5978,W=6119", Key: "1488230510.M141612P8565.mail.carlostrub.ch,S=5978,W=6119",
} }
err = m.Load("test/Maildir")
Ω(err).ShouldNot(HaveOccurred())
err = m.Learn(dbs["test/Maildir"], "test/Maildir") err = m.Learn(dbs["test/Maildir"], "test/Maildir")
Ω(err).ShouldNot(HaveOccurred()) Ω(err).ShouldNot(HaveOccurred())
}) })
@ -125,8 +118,8 @@ var _ = Describe("Classify Mails", func() {
answer, prob, err := Junk(dbs["test/Maildir2"], []string{"Carlo"}) answer, prob, err := Junk(dbs["test/Maildir2"], []string{"Carlo"})
Ω(err).Should(Equal(errors.New("no mails have yet been learned"))) Ω(err).ShouldNot(HaveOccurred())
Ω(prob).Should(Equal(0.0)) Ω(math.IsNaN(prob)).Should(BeTrue())
Ω(answer).Should(BeFalse()) Ω(answer).Should(BeFalse())
}) })

View File

@ -38,7 +38,6 @@ var _ = Describe("Learn", func() {
Junk: true, Junk: true,
} }
err = m.Load("test/Maildir")
Ω(err).ShouldNot(HaveOccurred()) Ω(err).ShouldNot(HaveOccurred())
}) })
AfterEach(func() { AfterEach(func() {