diff options
| author | Shyam Sunder | 2019-09-28 16:00:41 -0400 |
|---|---|---|
| committer | Shyam Sunder | 2019-09-28 18:58:45 -0400 |
| commit | 0c05330cfc634a37938ffe28e7c60da2a7935952 (patch) | |
| tree | cb9539231422e1b4960e5dc4b535fb3c47bd6e21 /server/szurubooru/tests/func | |
| parent | 1231469a3513685263bf77f16ee81026c39b389b (diff) | |
server/tests: fix failing tests
Diffstat (limited to 'server/szurubooru/tests/func')
| -rw-r--r-- | server/szurubooru/tests/func/test_image_hash.py | 9 | ||||
| -rw-r--r-- | server/szurubooru/tests/func/test_posts.py | 2 |
2 files changed, 10 insertions, 1 deletions
diff --git a/server/szurubooru/tests/func/test_image_hash.py b/server/szurubooru/tests/func/test_image_hash.py index 192d175..ce82477 100644 --- a/server/szurubooru/tests/func/test_image_hash.py +++ b/server/szurubooru/tests/func/test_image_hash.py @@ -1,3 +1,4 @@ +import pytest from szurubooru.func import image_hash @@ -7,8 +8,16 @@ def test_hashing(read_asset, config_injector): 'host': 'localhost', 'port': 9200, 'index': 'szurubooru_test', + 'user': 'szurubooru', + 'pass': None, }, }) + + if not image_hash.get_session().ping(): + pytest.xfail( + 'Unable to connect to ElasticSearch, ' + 'perhaps it is not available for this test?') + image_hash.purge() image_hash.add_image('test', read_asset('jpeg.jpg')) diff --git a/server/szurubooru/tests/func/test_posts.py b/server/szurubooru/tests/func/test_posts.py index d0c27ba..fc4cfc9 100644 --- a/server/szurubooru/tests/func/test_posts.py +++ b/server/szurubooru/tests/func/test_posts.py @@ -279,7 +279,7 @@ def test_update_post_source(): def test_update_post_source_with_too_long_string(): post = model.Post() with pytest.raises(posts.InvalidPostSourceError): - posts.update_post_source(post, 'x' * 1000) + posts.update_post_source(post, 'x' * 3000) @pytest.mark.parametrize( |