Skip to content

Commit 21d48c8

Browse files
committed
updates
1 parent e7c7413 commit 21d48c8

File tree

2 files changed

+63
-19
lines changed

2 files changed

+63
-19
lines changed

Pipfile.lock

Lines changed: 48 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/test_models.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import os
2+
13
import attr
24
import pytest
35
import requests_mock
@@ -60,6 +62,7 @@ def test_filtered_item_search(client):
6062

6163

6264
def test__pop_inst(client):
65+
"""Test _pop_inst function."""
6366
class_type = models.Collection
6467
rec_obj = {'name': 'Test title', 'type': 'collection', 'items': []}
6568
rec_obj = client._pop_inst(class_type, rec_obj)
@@ -68,18 +71,27 @@ def test__pop_inst(client):
6871

6972

7073
def test__build_uuid_list(client):
74+
"""Test _build_uuid_list function."""
7175
rec_obj = {'items': [{'uuid': '1234'}]}
7276
children = 'items'
7377
child_list = client._build_uuid_list(rec_obj, children)
7478
assert '1234' in child_list
7579

7680

77-
# def test_build_file_list_local():
78-
# file_list = models.build_file_list_local(directory, file_extension)
79-
# assert False
81+
def test_build_file_list_local():
82+
"""Test filtered_item_search function."""
83+
file_extension = 'pdf'
84+
directory = 'test_temp'
85+
os.mkdir(directory)
86+
open(f'{directory}/999.pdf', 'w')
87+
file_list = models.build_file_list_local(directory, file_extension)
88+
os.remove(f'{directory}/999.pdf')
89+
os.rmdir(directory)
90+
assert '999.pdf' in file_list
8091

8192

8293
def test_build_file_list_remote():
94+
"""Test build_file_list_remote function."""
8395
content = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html>'
8496
content += '<head><title>Index of /pdf</title></head><body><h1>Index of /'
8597
content += 'pdf</h1><table><tr><th>Name</th><th>Last modified</th><th>'

0 commit comments

Comments
 (0)