Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Oct 28, 2024
1 parent 72d863f commit 5997b6d
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions test_model_loading.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,30 @@
import unittest
from model_optimization import load_optimized_model # Replace with the actual module name

from model_optimization import \
load_optimized_model # Replace with the actual module name


class TestModelLoading(unittest.TestCase):
def test_model_loading(self):
"""Test if the optimized model loads correctly."""
model = load_optimized_model()
self.assertIsNotNone(model, "The model should not be None after loading.")
self.assertTrue(hasattr(model, 'predict'), "The loaded model should have a 'predict' method.")
self.assertIsNotNone(
model, "The model should not be None after loading.")
self.assertTrue(
hasattr(model, "predict"),
"The loaded model should have a 'predict' method.",
)

def test_model_input_shape(self):
"""Test if the model input shape is as expected."""
model = load_optimized_model()
input_shape = model.input_shape
self.assertEqual(input_shape, (None, 224, 224, 3), "Model input shape should be (None, 224, 224, 3).")
self.assertEqual(
input_shape,
(None, 224, 224, 3),
"Model input shape should be (None, 224, 224, 3).",
)


if __name__ == "__main__":
unittest.main()

0 comments on commit 5997b6d

Please sign in to comment.