Example #1
0
 def test_created(self):
     """
     Check the DataStore base class gets the requested item and returns the
     creation timestamp that the publisher has associated with the item.
     """
     self.assertTrue(hasattr(DataStore, 'created'))
     ds = DataStore()
     timestamp = time.time()
     val = {
         'timestamp': timestamp
     }
     ds._get_item = MagicMock(return_value=(val, None, 0.0))
     result = ds.created('foo')
     self.assertEqual(timestamp, result)
     ds._get_item.assert_called_once_with('foo')