Advertisement
Uno-Dan

Unit Testing

Sep 13th, 2019
285
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.40 KB | None | 0 0
  1. import unittest
  2.  
  3. from cache import Cache
  4.  
  5.  
  6. class TestCache(unittest.TestCase):
  7.  
  8.     def setUp(self):
  9.         """Set up test fixtures, if any."""
  10.  
  11.     def tearDown(self):
  12.         """Tear down test fixtures, if any."""
  13.  
  14.     def test_destroy(self):
  15.         data = {'abc': 123}
  16.         c = Cache(data)
  17.         self.assertEqual(c.get(), data)
  18.         c.destroy()
  19.         self.assertEqual(c.get(), {})
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement