Skip to content

Commit 83b7ce3

Browse files
committed
Properly deactivating test_statement_creation
1 parent 9493f01 commit 83b7ce3

1 file changed

Lines changed: 34 additions & 32 deletions

File tree

‎tests/integration/store_and_load_test.py‎

Lines changed: 34 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import sys
22
from pathlib import Path
33

4+
import pytest
5+
46
import osw.model.entity as model
57
from osw.auth import CredentialManager
68
from osw.core import OSW, AddOverwriteClassOptions, OverwriteOptions
79
from osw.utils.wiki import get_full_title
8-
9-
# from osw.wiki_tools import SearchParam
10+
from osw.wiki_tools import SearchParam
1011
from osw.wtsite import WtSite
1112

1213
# run with: tox -e test -- --wiki_domain domain --wiki_username user --wiki_password pass
@@ -142,36 +143,37 @@ def test_query_instances(wiki_domain, wiki_username, wiki_password):
142143
osw.delete_entity(my_item)
143144

144145

145-
# def test_statement_creation(wiki_domain, wiki_username, wiki_password):
146-
# cm = CredentialManager()
147-
# cm.add_credential(
148-
# CredentialManager.UserPwdCredential(
149-
# iri=wiki_domain, username=wiki_username, password=wiki_password
150-
# )
151-
# )
152-
# wtsite = WtSite(WtSite.WtSiteConfig(iri=wiki_domain, cred_mngr=cm))
153-
# osw = OSW(site=wtsite)
154-
#
155-
# my_entity = model.Item(
156-
# label=[model.Label(text="MyItem")],
157-
# statements=[
158-
# model.DataStatement(property="Property:TestProperty", value="TestValue")
159-
# ],
160-
# )
161-
#
162-
# osw.store_entity(my_entity)
163-
#
164-
# search_param = SearchParam(query="[[TestProperty::TestValue]]")
165-
# full_page_titles = osw.site.semantic_search(search_param)
166-
# assert f"Item:{OSW.get_osw_id(my_entity.uuid)}" in full_page_titles
167-
#
168-
# search_param = SearchParam(
169-
# query="[[HasStatement.HasProperty::Property:TestProperty]]"
170-
# )
171-
# full_page_titles = osw.site.semantic_search(search_param)
172-
# assert f"Item:{OSW.get_osw_id(my_entity.uuid)}" in full_page_titles
173-
#
174-
# osw.delete_entity(my_entity)
146+
@pytest.mark.skip(reason="Temporarily disabled - Failing due to unresolved error")
147+
def test_statement_creation(wiki_domain, wiki_username, wiki_password):
148+
cm = CredentialManager()
149+
cm.add_credential(
150+
CredentialManager.UserPwdCredential(
151+
iri=wiki_domain, username=wiki_username, password=wiki_password
152+
)
153+
)
154+
wtsite = WtSite(WtSite.WtSiteConfig(iri=wiki_domain, cred_mngr=cm))
155+
osw = OSW(site=wtsite)
156+
157+
my_entity = model.Item(
158+
label=[model.Label(text="MyItem")],
159+
statements=[
160+
model.DataStatement(property="Property:TestProperty", value="TestValue")
161+
],
162+
)
163+
164+
osw.store_entity(my_entity)
165+
166+
search_param = SearchParam(query="[[TestProperty::TestValue]]")
167+
full_page_titles = osw.site.semantic_search(search_param)
168+
assert f"Item:{OSW.get_osw_id(my_entity.uuid)}" in full_page_titles
169+
170+
search_param = SearchParam(
171+
query="[[HasStatement.HasProperty::Property:TestProperty]]"
172+
)
173+
full_page_titles = osw.site.semantic_search(search_param)
174+
assert f"Item:{OSW.get_osw_id(my_entity.uuid)}" in full_page_titles
175+
176+
osw.delete_entity(my_entity)
175177

176178

177179
def test_characteristic_creation(wiki_domain, wiki_username, wiki_password):

0 commit comments

Comments
 (0)