Advertisement
Uno-Dan

Unit Testing 2

Sep 13th, 2019
330
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.38 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.         c = Cache('abc', 123)
  16.         self.assertEqual(c.get('abc'), 123)
  17.         c.destroy()
  18.         self.assertEqual(c.get(), {})
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement