Example #1
0
def test_tags_setter_da():
    tags = [{'a': 2, 'c': 'd'} for _ in range(100)]
    da = DocumentArray([Document() for _ in range(100)])
    da.tags = tags
    assert da.tags == tags

    for x, doc in zip(tags, da):
        assert x == doc.tags
Example #2
0
def test_setter_wrong_len():
    da = DocumentArray([Document() for _ in range(100)])
    tags = [{'1': 2}]

    with pytest.raises(ValueError, match='the number of tags in the'):
        da.tags = tags