forked from infobyte/faraday
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_api_info.py
27 lines (22 loc) · 881 Bytes
/
test_api_info.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
'''
Faraday Penetration Test IDE
Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
See the file 'doc/LICENSE' for the license information
'''
import os
import pytest
@pytest.mark.usefixtures('logged_user')
class TestAPIInfoEndpoint:
def test_api_info(self, test_client):
current_dir = os.path.dirname(os.path.realpath(__file__))
# this is a bug on the info api!
# we require faraday to be a package since we can't import
# from base path when our current working dir is test_cases.
if 'test_cases' in current_dir:
faraday_base = os.path.join(current_dir, '..')
os.chdir(faraday_base)
response = test_client.get('v2/info')
assert response.status_code == 200
assert response.json['Faraday Server'] == 'Running'
# to avoid side effects
os.chdir(current_dir)