Skip to content

Commit

Permalink
Merge pull request #488 from weaviate/fix/#486
Browse files Browse the repository at this point in the history
Fix/#486
  • Loading branch information
tsmith023 committed Sep 11, 2023
2 parents 5cd711f + 1ff9e7a commit b95ac22
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 544 deletions.
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

0 comments on commit b95ac22

Please sign in to comment.