Skip to content

Commit 1916a74

Browse files
committed
Update tests
1 parent 6d7871d commit 1916a74

1 file changed

Lines changed: 16 additions & 3 deletions

File tree

tests/test_solid_api.py

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,34 @@ def gen_random_str() -> str:
1212
return uuid.uuid4().hex
1313

1414

15+
# base_url = 'https://dahanhsi.solidcommunity.net/'
16+
POD_ENDPOINT = 'https://pod.inrupt.com/petertc/'
17+
18+
1519
def test_folder():
16-
base_url = 'https://dahanhsi.solidcommunity.net/'
20+
base_url = POD_ENDPOINT
1721
folder_name = 'testfolder-' + gen_random_str()
1822
url = base_url + folder_name + '/'
1923

2024
api = SolidAPI(None)
25+
26+
try:
27+
api.delete_folder(url)
28+
except HTTPStatusError as e:
29+
if e.response.status_code != 404:
30+
raise e
31+
2132
api.create_folder(url)
2233
assert api.item_exists(url)
2334
api.delete_folder(url)
35+
assert not api.item_exists(url)
2436

2537
with pytest.raises(Exception):
2638
api.delete_folder(base_url)
2739

2840

2941
def test_read_folder():
30-
base_url = 'https://dahanhsi.solidcommunity.net/'
42+
base_url = POD_ENDPOINT
3143
folder_name = 'testfolder'
3244
url = base_url + folder_name + '/'
3345

@@ -94,7 +106,8 @@ def test_read_folder():
94106

95107

96108
def test_file():
97-
url = 'https://dahanhsi.solidcommunity.net/public/test.md.' + gen_random_str()
109+
base_url = POD_ENDPOINT
110+
url = POD_ENDPOINT + 'test.md.' + gen_random_str()
98111
api = SolidAPI(None)
99112

100113
assert not api.item_exists(url)

0 commit comments

Comments
 (0)