Implement Read Only mode
This commit is contained in:
parent
6464d92dd4
commit
e1bd235785
19 changed files with 544 additions and 335 deletions
|
@ -10,7 +10,7 @@ var book = map[string]interface{}{
|
|||
|
||||
func TestAddBook(t *testing.T) {
|
||||
db := Init(test_host, test_coll)
|
||||
defer db.del()
|
||||
defer del(db)
|
||||
|
||||
tAddBook(t, db)
|
||||
|
||||
|
@ -31,7 +31,7 @@ func TestAddBook(t *testing.T) {
|
|||
|
||||
func TestActiveBook(t *testing.T) {
|
||||
db := Init(test_host, test_coll)
|
||||
defer db.del()
|
||||
defer del(db)
|
||||
|
||||
tAddBook(t, db)
|
||||
books, _, _ := db.GetNewBooks("", 1, 0)
|
||||
|
@ -53,7 +53,7 @@ func TestActiveBook(t *testing.T) {
|
|||
|
||||
func TestFlag(t *testing.T) {
|
||||
db := Init(test_host, test_coll)
|
||||
defer db.del()
|
||||
defer del(db)
|
||||
|
||||
tAddBook(t, db)
|
||||
id, _ := book["id"].(string)
|
||||
|
@ -97,7 +97,7 @@ func TestFlag(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func tAddBook(t *testing.T, db *DB) {
|
||||
func tAddBook(t *testing.T, db DB) {
|
||||
err := db.AddBook(book)
|
||||
if err != nil {
|
||||
t.Error("db.AddBook(", book, ") return an error:", err)
|
||||
|
|
Reference in a new issue