Skip to content

Commit

Permalink
Create test_model_loading.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Harsimran-Dalal authored Oct 28, 2024
1 parent a0e6ded commit 72d863f
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test_model_loading.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import unittest
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.")

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).")

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

0 comments on commit 72d863f

Please sign in to comment.