Skip to content

Commit

Permalink
fix: broken test image
Browse files Browse the repository at this point in the history
  • Loading branch information
ZiniuYu committed Feb 21, 2023
1 parent 00116ce commit 6e07f2e
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 33 deletions.
2 changes: 1 addition & 1 deletion tests/test_asyncio.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ async def test_async_encode(make_flow):
DocumentArray(
[
Document(
uri='https://docarray.jina.ai/_static/favicon.png',
uri='https://raw.githubusercontent.com/jina-ai/clip-as-service/main/docs/_static/favicon.png',
text='hello, world',
),
]
Expand Down
14 changes: 7 additions & 7 deletions tests/test_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ def test_numpy_softmax(shape, axis):
Document(text='goodbye, world'),
Document(
text='hello, world',
uri='https://docarray.jina.ai/_static/favicon.png',
uri='https://raw.githubusercontent.com/jina-ai/clip-as-service/main/docs/_static/favicon.png',
),
Document(
uri='https://docarray.jina.ai/_static/favicon.png',
uri='https://raw.githubusercontent.com/jina-ai/clip-as-service/main/docs/_static/favicon.png',
),
]
),
Expand All @@ -47,14 +47,14 @@ def test_numpy_softmax(shape, axis):
Document(text='hello, world'),
Document(tensor=np.array([0, 1, 2])),
Document(
uri='https://docarray.jina.ai/_static/favicon.png'
uri='https://raw.githubusercontent.com/jina-ai/clip-as-service/main/docs/_static/favicon.png'
).load_uri_to_blob(),
Document(
tensor=np.array([0, 1, 2]),
uri='https://docarray.jina.ai/_static/favicon.png',
uri='https://raw.githubusercontent.com/jina-ai/clip-as-service/main/docs/_static/favicon.png',
),
Document(
uri='https://docarray.jina.ai/_static/favicon.png',
uri='https://raw.githubusercontent.com/jina-ai/clip-as-service/main/docs/_static/favicon.png',
),
]
),
Expand All @@ -64,7 +64,7 @@ def test_numpy_softmax(shape, axis):
DocumentArray(
[
Document(text='hello, world'),
Document(uri='https://docarray.jina.ai/_static/favicon.png'),
Document(uri='https://raw.githubusercontent.com/jina-ai/clip-as-service/main/docs/_static/favicon.png'),
]
),
(1, 1),
Expand All @@ -86,7 +86,7 @@ def test_split_img_txt_da(inputs):
DocumentArray(
[
Document(
uri='https://docarray.jina.ai/_static/favicon.png',
uri='https://raw.githubusercontent.com/jina-ai/clip-as-service/main/docs/_static/favicon.png',
).load_uri_to_blob(),
]
)
Expand Down
20 changes: 10 additions & 10 deletions tests/test_ranker.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,14 @@ async def test_torch_executor_rank_text2imgs(encoder_class):
[
[
Document(
uri='https://docarray.jina.ai/_static/favicon.png',
uri='https://raw.githubusercontent.com/jina-ai/clip-as-service/main/docs/_static/favicon.png',
matches=[
Document(text='hello, world'),
Document(text='goodbye, world'),
],
),
Document(
uri='https://docarray.jina.ai/_static/favicon.png',
uri='https://raw.githubusercontent.com/jina-ai/clip-as-service/main/docs/_static/favicon.png',
matches=[
Document(text='hello, world'),
Document(text='goodbye, world'),
Expand All @@ -85,14 +85,14 @@ async def test_torch_executor_rank_text2imgs(encoder_class):
DocumentArray(
[
Document(
uri='https://docarray.jina.ai/_static/favicon.png',
uri='https://raw.githubusercontent.com/jina-ai/clip-as-service/main/docs/_static/favicon.png',
matches=[
Document(text='hello, world'),
Document(text='goodbye, world'),
],
),
Document(
uri='https://docarray.jina.ai/_static/favicon.png',
uri='https://raw.githubusercontent.com/jina-ai/clip-as-service/main/docs/_static/favicon.png',
matches=[
Document(text='hello, world'),
Document(text='goodbye, world'),
Expand All @@ -102,7 +102,7 @@ async def test_torch_executor_rank_text2imgs(encoder_class):
),
lambda: (
Document(
uri='https://docarray.jina.ai/_static/favicon.png',
uri='https://raw.githubusercontent.com/jina-ai/clip-as-service/main/docs/_static/favicon.png',
matches=[
Document(text='hello, world'),
Document(text='goodbye, world'),
Expand All @@ -115,7 +115,7 @@ async def test_torch_executor_rank_text2imgs(encoder_class):
Document(
text='hello, world',
matches=[
Document(uri='https://docarray.jina.ai/_static/favicon.png'),
Document(uri='https://raw.githubusercontent.com/jina-ai/clip-as-service/main/docs/_static/favicon.png'),
Document(
uri=f'{os.path.dirname(os.path.abspath(__file__))}/img/00000.jpg'
),
Expand Down Expand Up @@ -144,7 +144,7 @@ def test_docarray_inputs(make_flow, inputs):
[
[
Document(
uri='https://docarray.jina.ai/_static/favicon.png',
uri='https://raw.githubusercontent.com/jina-ai/clip-as-service/main/docs/_static/favicon.png',
matches=[
Document(text='hello, world'),
Document(text='goodbye, world'),
Expand All @@ -154,7 +154,7 @@ def test_docarray_inputs(make_flow, inputs):
DocumentArray(
[
Document(
uri='https://docarray.jina.ai/_static/favicon.png',
uri='https://raw.githubusercontent.com/jina-ai/clip-as-service/main/docs/_static/favicon.png',
matches=[
Document(text='hello, world'),
Document(text='goodbye, world'),
Expand All @@ -164,7 +164,7 @@ def test_docarray_inputs(make_flow, inputs):
),
lambda: (
Document(
uri='https://docarray.jina.ai/_static/favicon.png',
uri='https://raw.githubusercontent.com/jina-ai/clip-as-service/main/docs/_static/favicon.png',
matches=[
Document(text='hello, world'),
Document(text='goodbye, world'),
Expand All @@ -177,7 +177,7 @@ def test_docarray_inputs(make_flow, inputs):
Document(
text='hello, world',
matches=[
Document(uri='https://docarray.jina.ai/_static/favicon.png'),
Document(uri='https://raw.githubusercontent.com/jina-ai/clip-as-service/main/docs/_static/favicon.png'),
Document(
uri=f'{os.path.dirname(os.path.abspath(__file__))}/img/00000.jpg'
),
Expand Down
4 changes: 2 additions & 2 deletions tests/test_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
lambda: (Document(text='hello, world') for _ in range(10)),
DocumentArray(
[
Document(uri='https://docarray.jina.ai/_static/favicon.png'),
Document(uri='https://raw.githubusercontent.com/jina-ai/clip-as-service/main/docs/_static/favicon.png'),
Document(
uri=f'{os.path.dirname(os.path.abspath(__file__))}/img/00000.jpg'
),
Expand Down Expand Up @@ -52,7 +52,7 @@ def test_index_search(make_search_flow, inputs, limit):
lambda: (Document(text='hello, world') for _ in range(10)),
DocumentArray(
[
Document(uri='https://docarray.jina.ai/_static/favicon.png'),
Document(uri='https://raw.githubusercontent.com/jina-ai/clip-as-service/main/docs/_static/favicon.png'),
Document(
uri=f'{os.path.dirname(os.path.abspath(__file__))}/img/00000.jpg'
),
Expand Down
12 changes: 6 additions & 6 deletions tests/test_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

def test_server_download(tmpdir):
download_model(
url='https://docarray.jina.ai/_static/favicon.png',
url='https://raw.githubusercontent.com/jina-ai/clip-as-service/main/docs/_static/favicon.png',
target_folder=tmpdir,
md5sum='66ea4817d73514888dcf6c7d2b00016d',
with_resume=False,
Expand All @@ -27,7 +27,7 @@ def test_server_download(tmpdir):
os.remove(target_path)

download_model(
url='https://docarray.jina.ai/_static/favicon.png',
url='https://raw.githubusercontent.com/jina-ai/clip-as-service/main/docs/_static/favicon.png',
target_folder=tmpdir,
md5sum='66ea4817d73514888dcf6c7d2b00016d',
with_resume=True,
Expand All @@ -40,15 +40,15 @@ def test_server_download(tmpdir):
def test_server_download_md5(tmpdir, md5):
if md5 != 'ABC':
download_model(
url='https://docarray.jina.ai/_static/favicon.png',
url='https://raw.githubusercontent.com/jina-ai/clip-as-service/main/docs/_static/favicon.png',
target_folder=tmpdir,
md5sum=md5,
with_resume=False,
)
else:
with pytest.raises(Exception):
download_model(
url='https://docarray.jina.ai/_static/favicon.png',
url='https://raw.githubusercontent.com/jina-ai/clip-as-service/main/docs/_static/favicon.png',
target_folder=tmpdir,
md5sum=md5,
with_resume=False,
Expand All @@ -58,7 +58,7 @@ def test_server_download_md5(tmpdir, md5):
def test_server_download_not_regular_file(tmpdir):
with pytest.raises(Exception):
download_model(
url='https://docarray.jina.ai/_static/favicon.png',
url='https://raw.githubusercontent.com/jina-ai/clip-as-service/main/docs/_static/favicon.png',
target_folder=tmpdir,
md5sum='',
with_resume=False,
Expand Down Expand Up @@ -87,7 +87,7 @@ def test_make_onnx_flow_wrong_name_path():
'image_uri',
[
f'{os.path.dirname(os.path.abspath(__file__))}/img/00000.jpg',
'https://docarray.jina.ai/_static/favicon.png',
'https://raw.githubusercontent.com/jina-ai/clip-as-service/main/docs/_static/favicon.png',
],
)
@pytest.mark.parametrize('size', [224, 288, 384, 448])
Expand Down
8 changes: 4 additions & 4 deletions tests/test_simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def test_protocols(port_generator, protocol, jit, pytestconfig):
('hello, world', 'goodbye, world'),
lambda: ('hello, world' for _ in range(10)),
[
'https://docarray.jina.ai/_static/favicon.png',
'https://raw.githubusercontent.com/jina-ai/clip-as-service/main/docs/_static/favicon.png',
f'{os.path.dirname(os.path.abspath(__file__))}/img/00000.jpg',
'hello, world',
],
Expand All @@ -58,7 +58,7 @@ def test_plain_inputs(make_flow, inputs):
lambda: (Document(text='hello, world') for _ in range(10)),
DocumentArray(
[
Document(uri='https://docarray.jina.ai/_static/favicon.png'),
Document(uri='https://raw.githubusercontent.com/jina-ai/clip-as-service/main/docs/_static/favicon.png'),
Document(
uri=f'{os.path.dirname(os.path.abspath(__file__))}/img/00000.jpg'
),
Expand Down Expand Up @@ -90,7 +90,7 @@ def test_docarray_inputs(make_flow, inputs):
DocumentArray(
[
Document(
uri='https://docarray.jina.ai/_static/favicon.png',
uri='https://raw.githubusercontent.com/jina-ai/clip-as-service/main/docs/_static/favicon.png',
text='hello, world',
),
]
Expand All @@ -117,7 +117,7 @@ def test_docarray_preserve_original_inputs(make_flow, inputs):
DocumentArray(
[
Document(
uri='https://docarray.jina.ai/_static/favicon.png',
uri='https://raw.githubusercontent.com/jina-ai/clip-as-service/main/docs/_static/favicon.png',
text='hello, world',
),
]
Expand Down
6 changes: 3 additions & 3 deletions tests/test_tensorrt.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
lambda: (Document(text='hello, world') for _ in range(10)),
DocumentArray(
[
Document(uri='https://docarray.jina.ai/_static/favicon.png'),
Document(uri='https://raw.githubusercontent.com/jina-ai/clip-as-service/main/docs/_static/favicon.png'),
Document(
uri=f'{os.path.dirname(os.path.abspath(__file__))}/img/00000.jpg'
),
Expand Down Expand Up @@ -47,13 +47,13 @@ def test_docarray_inputs(make_trt_flow, inputs):
'd',
[
Document(
uri='https://docarray.jina.ai/_static/favicon.png',
uri='https://raw.githubusercontent.com/jina-ai/clip-as-service/main/docs/_static/favicon.png',
matches=[Document(text='hello, world'), Document(text='goodbye, world')],
),
Document(
text='hello, world',
matches=[
Document(uri='https://docarray.jina.ai/_static/favicon.png'),
Document(uri='https://raw.githubusercontent.com/jina-ai/clip-as-service/main/docs/_static/favicon.png'),
Document(
uri=f'{os.path.dirname(os.path.abspath(__file__))}/img/00000.jpg'
),
Expand Down

0 comments on commit 6e07f2e

Please sign in to comment.