Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add unit tests #18

Merged
merged 13 commits into from
Jul 10, 2019
39 changes: 24 additions & 15 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,37 @@
version: 2
jobs:
build:
machine:
image: ubuntu-1604:201903-01
docker_layer_caching: true
test:
docker:
- image: preethamkamidi/verifytweet-base:latest
steps:
- checkout
- restore_cache:
key: v1-py-cache-{{ .Branch }}-{{ checksum "requirements-dev.txt" }}-{{ checksum "requirements.txt" }}
- run:
name: Install Dependencies
name: Setup venv and install requirements
command: |
echo 'export TAG=$(grep -oE "\"(.*?)\"" verifytweet/__init__.py)' >> $BASH_ENV
echo 'export TAG=${TAG:1:5}' >> $BASH_ENV
echo 'export IMAGE_NAME=verifytweet' >> $BASH_ENV
python3 -m venv ~/.venv
echo ". ~/.venv/bin/activate" >> $BASH_ENV
source $BASH_ENV
pip install -r requirements.txt -r requirements-dev.txt
- save_cache:
name: Save Python dependencies cache
key: v1-py-cache-{{ .Branch }}-{{ checksum "requirements-dev.txt" }}-{{ checksum "requirements.txt" }}
paths:
- ~/.venv
- run:
name: Build and push Docker image
command: |
docker build -t preethamkamidi/$IMAGE_NAME:$TAG .
echo $DOCKER_PWD | docker login -u $DOCKER_USER --password-stdin
docker push preethamkamidi/$IMAGE_NAME:$TAG
name: Run tests
command: pytest

workflows:
version: 2
build_and_push:
build_and_test:
jobs:
- build:
- test:
filters:
tags:
only: /^v.*/
branches:
only:
- master
- develop
4 changes: 4 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ yapf = "*"
sphinx = "*"
pytest = "*"
twine = "*"
bandit = "*"
hypothesis = "*"
coverage = "*"
pytest-cov = "*"

[packages]
certifi = "*"
Expand Down
192 changes: 152 additions & 40 deletions Pipfile.lock

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions ext/CurrentDataFlow.svg

This file was deleted.

54 changes: 54 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
-i https://pypi.org/simple
alabaster==0.7.12
atomicwrites==1.3.0
attrs==19.1.0
autopep8==1.4.4
babel==2.7.0
bandit==1.6.2
bleach==3.1.0
certifi==2019.6.16
chardet==3.0.4
coverage==4.5.3
docutils==0.14
gitdb2==2.0.5
gitpython==2.1.11
hypothesis==4.26.4
idna==2.8
imagesize==1.1.0
importlib-metadata==0.18
jinja2==2.10.1
markupsafe==1.1.1
more-itertools==7.1.0
packaging==19.0
pbr==5.4.0
pkginfo==1.5.0.1
pluggy==0.12.0
py==1.8.0
pycodestyle==2.5.0
pygments==2.4.2
pyparsing==2.4.0
pytest-cov==2.7.1
pytest==5.0.1
pytz==2019.1
pyyaml==5.1.1
readme-renderer==24.0
requests-toolbelt==0.9.1
requests==2.22.0
six==1.12.0
smmap2==2.0.5
snowballstemmer==1.9.0
sphinx==2.1.2
sphinxcontrib-applehelp==1.0.1
sphinxcontrib-devhelp==1.0.1
sphinxcontrib-htmlhelp==1.0.2
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.2
sphinxcontrib-serializinghtml==1.1.3
stevedore==1.30.1
tqdm==4.32.2
twine==1.13.0
urllib3==1.25.3
wcwidth==0.1.7
webencodings==0.5.1
yapf==0.27.0
zipp==0.5.2
61 changes: 16 additions & 45 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,91 +1,62 @@
-i https://pypi.org/simple
-e git+https://github.com/twintproject/twint.git@ad27650fbc0bf8c3f2c78449088a5ede7239f53a#egg=twint
aiodns==2.0.0
aiohttp==3.5.4
aiohttp-socks==0.2.2
alabaster==0.7.12
aiohttp==3.5.4
async-timeout==3.0.1
atomicwrites==1.3.0
attrs==19.1.0
autopep8==1.4.4
Babel==2.7.0
beautifulsoup4==4.7.1
bleach==3.1.0
cchardet==2.1.4
certifi==2019.6.16
cffi==1.12.3
chardet==3.0.4
Click==7.0
click==7.0
cycler==0.10.0
decorator==4.4.0
dnspython==1.16.0
docutils==0.14
elasticsearch==7.0.2
eventlet==0.25.0
fake-useragent==0.1.11
Flask==1.0.3
Flask-Cors==3.0.8
flask-cors==3.0.8
flask==1.1.0
geographiclib==1.49
geopy==1.20.0
greenlet==0.4.15
gunicorn==19.9.0
idna-ssl==1.1.0 ; python_version < '3.7'
idna==2.8
idna-ssl==1.1.0
imageio==2.5.0
imagesize==1.1.0
importlib-metadata==0.18
itsdangerous==1.1.0
Jinja2==2.10.1
jinja2==2.10.1
joblib==0.13.2
kiwisolver==1.1.0
MarkupSafe==1.1.1
markupsafe==1.1.1
monotonic==1.5
more-itertools==7.1.0
multidict==4.5.2
networkx==2.3
nltk==3.4.3
nltk==3.4.4
numpy==1.16.4
packaging==19.0
pandas==0.24.2
Pillow==6.0.0
pkginfo==1.5.0.1
pluggy==0.12.0
py==1.8.0
pillow==6.1.0
pycares==3.0.0
pycodestyle==2.5.0
pycparser==2.19
Pygments==2.4.2
pyparsing==2.4.0
PySocks==1.7.0
pysocks==1.7.0
pytesseract==0.2.7
pytest==5.0.0
python-dateutil==2.8.0
pytz==2019.1
PyWavelets==1.0.3
readme-renderer==24.0
pywavelets==1.0.3
regex==2019.6.8
requests==2.22.0
requests-toolbelt==0.9.1
schedule==0.6.0
scikit-learn==0.21.2
scipy==1.3.0
six==1.12.0
snowballstemmer==1.9.0
soupsieve==1.9.2
Sphinx==2.1.2
sphinxcontrib-applehelp==1.0.1
sphinxcontrib-devhelp==1.0.1
sphinxcontrib-htmlhelp==1.0.2
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.2
sphinxcontrib-serializinghtml==1.1.3
tqdm==4.32.2
twine==1.13.0
-e git+https://github.com/twintproject/twint.git@c5c6f1d60554cd0ee64ba223850b070553a17e74#egg=twint
typing==3.7.4
typing-extensions==3.7.4
typing-extensions==3.7.4 ; python_version < '3.7'
typing==3.7.4 ; python_version < '3.7'
urllib3==1.25.3
wcwidth==0.1.7
webencodings==0.5.1
Werkzeug==0.15.4
werkzeug==0.15.4
yapf==0.27.0
yarl==1.3.0
zipp==0.5.1
Loading