Spaces:
Build error
Build error
Create Test/test_model_foo.py
Browse files- Test/test_model_foo.py +22 -0
Test/test_model_foo.py
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import unittest
|
2 |
+
from my_app.models.foo import FooModel
|
3 |
+
|
4 |
+
class TestFooModel(unittest.TestCase):
|
5 |
+
def setUp(self):
|
6 |
+
self.foo_model = FooModel()
|
7 |
+
|
8 |
+
def tearDown(self):
|
9 |
+
del self.foo_model
|
10 |
+
|
11 |
+
def test_some_method(self):
|
12 |
+
# Arrange
|
13 |
+
some_data = {"key": "value"}
|
14 |
+
|
15 |
+
# Act
|
16 |
+
result = self.foo_model.some_method(some_data)
|
17 |
+
|
18 |
+
# Assert
|
19 |
+
self.assertTrue(result)
|
20 |
+
|
21 |
+
if __name__ == '__main__':
|
22 |
+
unittest.main()
|