diff --git a/tests/test_pub1c-rest.py b/tests/test_pub1c-rest.py index 412081f..30fcde3 100644 --- a/tests/test_pub1c-rest.py +++ b/tests/test_pub1c-rest.py @@ -213,3 +213,24 @@ def test_api_publication_set_url(client): data = response.get_json() assert data['url'] == '/1c/another/url' + +def test_api_infobases_all(client): + # add publications + client.put(path='/api/v1/publications', data={'name': 'test1'}) + # get list + response = client.get('/api/v1/infobases-all') + data = response.get_json() + assert len(data) == 3 + # bpdemo + assert data[0]['name'] == 'bpdemo' + assert not data[0]['publicated'] + assert data[0]['url'] == '' + # test1 + assert data[1]['name'] == 'test1' + assert data[1]['publicated'] + assert data[1]['url'] == '/1c/test1' + assert not data[1]['is_file_infobase'] + # test2 + assert data[2]['name'] == 'test2' + assert not data[2]['publicated'] + assert data[2]['url'] == ''