Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/#486 #488

Merged
merged 6 commits into from
Sep 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions integration/test_schema.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from typing import Optional

import pytest
import requests

import weaviate
from weaviate import Tenant, TenantActivityStatus
Expand Down Expand Up @@ -120,6 +121,19 @@ def test_class_tenants(client: weaviate.Client):
assert len(tenants_get) == 1


def test_update_schema_with_no_properties(client: weaviate.Client):
single_class = {"class": "NoProperties"}

requests.post("http://localhost:8080/v1/schema", json=single_class)
assert client.schema.exists("NoProperties")

client.schema.update_config("NoProperties", {"vectorIndexConfig": {"ef": 64}})
assert client.schema.exists("NoProperties")

client.schema.delete_class("NoProperties")
assert client.schema.exists("NoProperties") is False


def test_class_tenants_activate_deactivate(client: weaviate.Client):
class_name = "MultiTenancyActivateDeactivateSchemaTest"
uncap_class_name = "multiTenancyActivateDeactivateSchemaTest"
Expand Down
7 changes: 0 additions & 7 deletions test/schema/properties/test_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from test.util import mock_connection_func, check_error_message, check_startswith_error_message
from weaviate.exceptions import (
UnexpectedStatusCodeException,
SchemaValidationException,
)
from weaviate.schema.properties import Property

Expand All @@ -21,18 +20,12 @@ def test_create(self):

# invalid calls
error_message = "Class name must be of type str but is "
check_property_error_message = 'Property does not contain "dataType"'
requests_error_message = "Property was created properly."

with self.assertRaises(TypeError) as error:
prop.create(35, {})
check_error_message(self, error, error_message + str(int))

# test if `check_property` is called in `create`
with self.assertRaises(SchemaValidationException) as error:
prop.create("Class", {})
check_error_message(self, error, check_property_error_message)

prop = Property(mock_connection_func("post", side_effect=RequestsConnectionError("Test!")))
with self.assertRaises(RequestsConnectionError) as error:
prop.create("Class", {"name": "test", "dataType": ["test_type"]})
Expand Down
Loading
Loading