func TestCollection_Insert(t *testing.T) { bucket, _ := redis.NewBucket(config) adminUsers := collections.NewList("admins", bucket) adminUsers.Clean() adminUsers.Insert(admin) if adminUsers.Size() != 1 { t.Errorf("Want 1 got %d\n", adminUsers.Size()) } }
func TestDataset_Insert(t *testing.T) { bucket, _ := redis.NewBucket(config) dataset := storage.NewDataset("iris", bucket) dataset.Clean() col1 := collections.NewList("setosa", bucket) col2 := collections.NewHash("virginica", bucket) dataset.Insert(col1.Name, col1) dataset.Insert(col1.Name, col2) // TODO(datagentleman): will be fixed after Hash.All() will be implemented // collections := dataset.All() // if len(collections) != 2 { // t.Errorf("Want 2 got %d\n", len(collections)) // } }