Skip to content

Commit 4544881

Browse files
Reformatting.
1 parent eb14482 commit 4544881

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

app/main_test.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,20 @@
77

88
client = TestClient(app)
99

10+
1011
class ClassifierAPITest(unittest.TestCase):
1112

1213
TEST_COLOR_IMG_URL = "https://storage.googleapis.com/download.tensorflow.org/example_images/592px-Red_sunflower.jpg"
1314

1415
def test_make_prediction_normal(self):
15-
'''Client submits a RGB image and gets a valid response.'''
16+
"""Client submits a RGB image and gets a valid response."""
1617
# A: get image
1718
image_path = tf.keras.utils.get_file(
18-
origin=self.TEST_COLOR_IMG_URL,
19-
cache_dir=".", cache_subdir="./test-assets"
19+
origin=self.TEST_COLOR_IMG_URL, cache_dir=".", cache_subdir="./test-assets"
2020
)
21-
with open(image_path, 'rb') as f:
21+
with open(image_path, "rb") as f:
2222
# B: format a mock request
2323
files = {"file": (f.name, f, "multipart/form-data")}
2424
# C: make a request, and verify a valid prediction is returned
25-
response = client.post(
26-
'/detect-fire', files=files
27-
)
25+
response = client.post("/detect-fire", files=files)
2826
assert response.status_code == 307

classifier/util/model.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ def __init__(self, config: Dict[str, str]):
2626

2727
@classmethod
2828
def reconstruct_model(cls, config):
29-
'''Make a new instance, and load in the model straightaway.'''
29+
"""Make a new instance, and load in the model straightaway."""
3030
model_utility = cls(config)
3131
# detect save format
32-
save_format = 'composite'
32+
save_format = "composite"
3333
if config["model_file_paths"] and len(config["model_file_paths"]) == 1:
34-
save_format = 'h5'
34+
save_format = "h5"
3535
# load the model
3636
return model_utility.load_model(save_format)
3737

0 commit comments

Comments
 (0)