From e2c284da6872a21d78bf4cbb375c0b545836c0ca Mon Sep 17 00:00:00 2001 From: Ben Bangert Date: Thu, 3 Jan 2019 14:02:11 -0800 Subject: [PATCH] fix: return correct not found for disconnected client and fix tests Tests weren't passing because autopush had a dependency change for FCM. This updates the travis test to pull down the current dependencies for autopush for integration tests. Closes #89 --- .gitignore | 2 ++ .travis.yml | 2 ++ requirements.txt | 62 ------------------------------------------- src/http.rs | 2 +- test-requirements.txt | 15 ----------- 5 files changed, 5 insertions(+), 78 deletions(-) delete mode 100644 requirements.txt delete mode 100644 test-requirements.txt diff --git a/.gitignore b/.gitignore index 86d762068..5a08b543d 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,5 @@ autopush_rs/target autopush_rs/_native* target *.rs.bk +requirements.txt +test-requirements.txt diff --git a/.travis.yml b/.travis.yml index 26b25eac9..4b94a1347 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,6 +11,8 @@ dist: trusty install: - make ddb +- curl https://raw.githubusercontent.com/mozilla-services/autopush-rs/master/requirements.txt > requirements.txt +- curl https://raw.githubusercontent.com/mozilla-services/autopush-rs/master/test-requirements.txt > test-requirements.txt - pip install --upgrade pip - pip install -r requirements.txt - pip install -r test-requirements.txt diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 027d59a24..000000000 --- a/requirements.txt +++ /dev/null @@ -1,62 +0,0 @@ --e git+https://github.com/habnabit/txstatsd.git@157ef85fbdeafe23865c7c4e176237ffcb3c3f1f#egg=txStatsD-master -apns==2.0.1 -asn1crypto==0.24.0 # via cryptography -attrs==18.2.0 -autobahn[twisted]==18.9.2 -automat==0.7.0 # via twisted -boto3==1.9.18 -botocore==1.12.18 # via boto3, s3transfer -certifi==2018.8.24 # via requests -cffi==1.11.5 -chardet==3.0.4 # via requests -click==7.0 -configargparse==0.13.0 -constantly==15.1.0 # via twisted -contextlib2==0.5.5 # via raven -cryptography==2.3.1 -cyclone==1.1 -datadog==0.22.0 -decorator==4.3.0 # via datadog -docutils==0.14 # via botocore -ecdsa==0.13 # via python-jose -enum34==1.1.6 # via cryptography, h2 -future==0.16.0 # via python-jose -futures==3.2.0 # via s3transfer -gcm-client==0.1.4 -graphviz==0.9 # via objgraph -h2==2.6.2 # via hyper -hpack==3.0.0 # via h2 -hyper==0.7.0 -hyperframe==3.2.0 # via h2, hyper -hyperlink==18.0.0 # via twisted -idna==2.7 # via cryptography, hyperlink, requests, twisted -incremental==17.5.0 # via treq, twisted -ipaddress==1.0.22 # via cryptography -jmespath==0.9.3 # via boto3, botocore -marshmallow-polyfield==3.2 -marshmallow==2.15.6 -objgraph==3.4.0 -pyasn1-modules==0.2.2 # via service-identity -pyasn1==0.4.4 -pycparser==2.19 # via cffi -pyfcm==1.4.5 -pyhamcrest==1.9.0 # via twisted -pyopenssl==18.0.0 -python-dateutil==2.7.3 # via botocore -python-jose==3.0.1 -raven==6.9.0 -requests-toolbelt==0.8.0 # via pyfcm -requests==2.20.1 -rsa==4.0 # via python-jose -s3transfer==0.1.13 # via boto3 -service-identity==17.0.0 -simplejson==3.16.0 -six==1.11.0 # via autobahn, automat, cryptography, pyhamcrest, pyopenssl, python-dateutil, python-jose, treq, txaio -treq==18.6.0 -twisted[tls]==18.7.0 -txaio==18.8.1 # via autobahn -typing==3.6.6 -ua-parser==0.8.0 -urllib3==1.23 # via botocore, requests -wsaccel==0.6.2 ; platform_python_implementation == "CPython" -zope.interface==4.5.0 diff --git a/src/http.rs b/src/http.rs index 56df8825e..086f0772a 100644 --- a/src/http.rs +++ b/src/http.rs @@ -57,7 +57,7 @@ impl Service for Push { Ok(hyper::Response::new().with_status(StatusCode::Ok)) } else { Ok(hyper::Response::new() - .with_status(StatusCode::BadGateway) + .with_status(StatusCode::NotFound) .with_body("Client not available.")) } } else { diff --git a/test-requirements.txt b/test-requirements.txt deleted file mode 100644 index 357ff5249..000000000 --- a/test-requirements.txt +++ /dev/null @@ -1,15 +0,0 @@ -bottle==0.12.13 -coverage -ecdsa==0.13 -factory_boy==2.8.1 -flake8==3.3.0 -funcsigs==1.0.2 -mock>=1.0.1 --e git+https://github.com/bbangert/moto.git@3bdb75a961148ea5aa526f0e88d9e7835a30df3a#egg=moto -nose -pbr==1.10.0 -psutil -pympler==0.5 -pytest -pytest-cov -websocket-client