Skip to content

Commit

Permalink
fix: return correct not found for disconnected client and fix tests
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bbangert committed Jan 3, 2019
1 parent 8866986 commit 5d6d29d
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 79 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,5 @@ autopush_rs/target
autopush_rs/_native*
target
*.rs.bk
requirements.txt
test-requirements.txt
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ dist: trusty

install:
- make ddb
- curl https://raw.githubusercontent.com/mozilla-services/autopush/master/requirements.txt > requirements.txt
- curl https://raw.githubusercontent.com/mozilla-services/autopush/master/test-requirements.txt > test-requirements.txt
- pip install --upgrade pip
- pip install bottle
- pip install -r requirements.txt
- pip install -r test-requirements.txt
- pip install -e git+https://github.com/mozilla-services/autopush.git#egg=autopush
Expand Down
62 changes: 0 additions & 62 deletions requirements.txt

This file was deleted.

4 changes: 2 additions & 2 deletions src/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -71,7 +71,7 @@ impl Service for Push {
if srv.check_client_storage(uaid).is_ok() {
response.set_status(StatusCode::Ok)
} else {
response.set_status(StatusCode::BadGateway);
response.set_status(StatusCode::NotFound);
response.set_body("Client not available.");
}
}
Expand Down
15 changes: 0 additions & 15 deletions test-requirements.txt

This file was deleted.

0 comments on commit 5d6d29d

Please sign in to comment.