(t *testing.T)
| 668 | } |
| 669 | |
| 670 | func Test_ReferenceDelete_Ref2Vec(t *testing.T) { |
| 671 | t.Parallel() |
| 672 | |
| 673 | ctx, cancel := context.WithTimeout(context.Background(), time.Minute) |
| 674 | defer cancel() |
| 675 | |
| 676 | m := newFakeGetManager(articleSchemaForTest()) |
| 677 | |
| 678 | req := DeleteReferenceInput{ |
| 679 | Class: "Article", |
| 680 | ID: strfmt.UUID("e1a60252-c38c-496d-8e54-306e1cedc5c4"), |
| 681 | Property: "hasParagraphs", |
| 682 | Reference: models.SingleRef{ |
| 683 | Beacon: strfmt.URI("weaviate://localhost/Paragraph/494a2fe5-3e4c-4e9a-a47e-afcd9814f5ea"), |
| 684 | }, |
| 685 | } |
| 686 | |
| 687 | tenant := "randomTenant" |
| 688 | |
| 689 | parent := &search.Result{ |
| 690 | ID: strfmt.UUID("e1a60252-c38c-496d-8e54-306e1cedc5c4"), |
| 691 | ClassName: "Article", |
| 692 | Schema: map[string]interface{}{}, |
| 693 | } |
| 694 | |
| 695 | ref1 := &search.Result{ |
| 696 | ID: strfmt.UUID("494a2fe5-3e4c-4e9a-a47e-afcd9814f5ea"), |
| 697 | ClassName: "Paragraph", |
| 698 | Vector: []float32{2, 4, 6}, |
| 699 | } |
| 700 | |
| 701 | m.repo.On("Exists", "Article", parent.ID).Return(true, nil) |
| 702 | m.repo.On("Exists", "Paragraph", ref1.ID).Return(true, nil) |
| 703 | m.repo.On("Object", req.Class, req.ID, search.SelectProperties{}, additional.Properties{}, tenant).Return(parent, nil) |
| 704 | m.repo.On("PutObject", parent.Object(), []float32(nil)).Return(nil) |
| 705 | m.modulesProvider.On("UsingRef2Vec", mock.Anything).Return(true) |
| 706 | |
| 707 | err := m.Manager.DeleteObjectReference(ctx, nil, &req, nil, tenant) |
| 708 | assert.Nil(t, err) |
| 709 | } |
| 710 | |
| 711 | func articleSchemaForTest() schema.Schema { |
| 712 | return schema.Schema{ |
nothing calls this directly
no test coverage detected
searching dependent graphs…