Exemplo n.º 1
0
// test nil cache addRecord
func TestNoneAddRecord(t *testing.T) {
	noneReset()
	err := cache.AddRecord(&shaman.Resource{})
	if err != nil {
		t.Errorf("Failed to add record to none cacher - %v", err)
	}
}
Exemplo n.º 2
0
// test scribble cache addRecord
func TestScribbleAddRecord(t *testing.T) {
	scribbleReset()
	err := cache.AddRecord(&nanopack)
	if err != nil {
		t.Errorf("Failed to add record to scribble cacher - %v", err)
	}
}
Exemplo n.º 3
0
// test scribble cache deleteRecord
func TestScribbleDeleteRecord(t *testing.T) {
	scribbleReset()
	err := cache.DeleteRecord("nanobox.io")
	cache.AddRecord(&nanopack)
	err2 := cache.DeleteRecord("nanopack.io")
	if err != nil || err2 != nil {
		t.Errorf("Failed to delete record from scribble cacher - %v%v", err, err2)
	}
}
Exemplo n.º 4
0
// test scribble cache getRecord
func TestScribbleGetRecord(t *testing.T) {
	scribbleReset()
	cache.AddRecord(&nanopack)
	_, err := cache.GetRecord("nanobox.io")
	_, err2 := cache.GetRecord("nanopack.io")
	if err == nil || err2 != nil {
		t.Errorf("Failed to get record from scribble cacher - %v%v", err, err2)
	}
}