Skip to content

Commit 5bf3ba6

Browse files
Adjust where test files go, add Travis CI.
1 parent beb87f3 commit 5bf3ba6

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

.gitignore

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,10 @@ __pycache__/
1111
.vscode
1212

1313
# Keras Models
14-
*model/*
14+
model/
1515

1616
# Images Downloaded for Testing
17-
*.jpg
18-
*.jpeg
19-
*.png
17+
test-assets/
2018

2119
# Distribution / packaging
2220
.Python

.travis.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
language: python
2+
python:
3+
- "3.6"
4+
# command to install dependencies
5+
install:
6+
- pip install -r requirements.txt
7+
# command to run tests
8+
script:
9+
- pytest

app/main_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def test_make_prediction_normal(self):
1616
# A: get image
1717
image_path = tf.keras.utils.get_file(
1818
origin=self.TEST_COLOR_IMG_URL,
19-
cache_dir=".", cache_subdir="."
19+
cache_dir=".", cache_subdir="./test-assets"
2020
)
2121
with open(image_path, 'rb') as f:
2222
# B: format a mock request
@@ -25,4 +25,4 @@ def test_make_prediction_normal(self):
2525
response = client.post(
2626
'/detect-fire', files=files
2727
)
28-
assert response.status_code == 307
28+
assert response.status_code == 307

0 commit comments

Comments
 (0)