-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathpytest.sh
executable file
·57 lines (47 loc) · 1.78 KB
/
pytest.sh
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/usr/bin/env bash
# Script location directory:
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
export PYTHONPATH=$DIR
# export FLASK_ENV=development
export FLASK_APP=orcid_hub
export LANG=en_US.UTF-8
export ENV=test
# export ENV=dev0
export FLASK_DEBUG=1
export TOKEN_PASSWORD_SALT=testsalt
## flask process
export DATABASE_URL="sqlite:///:memory:"
export EXTERNAL_SP=''
# EXTERNAL_SP=https://dev.orcidhub.org.nz/Tuakiri/SP
# [ -z $RQ_REDIS_URL ] && RQ_REDIS_URL=redis://redis:6379/0
export RQ_REDIS_URL=''
export LOAD_TEST=1
export RQ_ASYNC=0
export RQ_CONNECTION_CLASS=fakeredis.FakeStrictRedis
export ORCID_API_BASE="https://api.sandbox.orcid.org/v2.0/"
export ORCID_BASE_URL="https://sandbox.orcid.org/"
export SECRET_KEY="***********"
export ORCID_CLIENT_ID=APP-1234567890123456
export ORCID_CLIENT_SECRET=aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee
export AUTHORIZATION_BASE_URL="${ORCID_BASE_URL}oauth/authorize"
export TOKEN_URL="${ORCID_BASE_URL}oauth/token"
export TESTING=True
export OAUTHLIB_INSECURE_TRANSPORT=1
export TEMPLATES_AUTO_RELOAD=True
export OAUTH2_PROVIDER_TOKEN_EXPIRES_IN=86400
# add mail server config
# MAIL_PORT=2525
# MAIL_SUPPRESS_SEND=False
# MAIL_DEFAULT_SENDER="no-reply@orcidhub.org.nz"
# MAIL_SERVER="dev.orcidhub.org.nz"
export MEMBER_API_FORM_BASE_URL="https://orcid.org/content/register-client-application-sandbox"
export MEMBER_API_FORM_MAIL=0
export NOTE_ORCID="An NZ ORCID Hub integration for"
export CRED_TYPE_PREMIUM=2
export APP_NAME="NZ ORCID HUB"
export APP_DESCRIPTION="This is an ORCID integration through the NZ ORCID HUB connecting"
export DEFAULT_COUNTRY="NZ"
[[ $@ == *tests* || $@ == *test*.py* ]] || dest=tests
pytest --ignore=venv --ignore=orcid_api -v --cov-config .coveragerc --cov . $dest $@
# OAUTHLIB_INSECURE_TRANSPORT=1
# P12_PASSWORD=p455w0rd