Esempio n. 1
0
 def test_updated(self):
     """
     Check the DataStore base class gets the requested item and returns the
     timestamp in position 1 of the tuple.
     """
     self.assertTrue(hasattr(DataStore, 'updated'))
     ds = DataStore()
     timestamp = time.time()
     ds._get_item = MagicMock(return_value=(None, timestamp, None))
     result = ds.updated('foo')
     self.assertEqual(timestamp, result)
     ds._get_item.assert_called_once_with('foo')