@mock.patch.object(stack, 'oslo_timeutils')
def test_time_elapsed(self, mock_tu):
    self.stack = stack.Stack(self.ctx, 'test_stack', self.tmpl)
    self.stack.created_time = datetime.datetime(2015, 7, 27, 10, 0, 0)
    mock_tu.utcnow.return_value = datetime.datetime(2015, 7, 27, 10, 10, 0)
    self.assertEqual(600, self.stack.time_elapsed())
@mock.patch.object(stack, 'oslo_timeutils')
def test_time_elapsed(self, mock_tu):
    self.stack = stack.Stack(self.ctx, 'test_stack', self.tmpl)
    self.stack.created_time = datetime.datetime(2015, 7, 27, 10, 0, 0)
    mock_tu.utcnow.return_value = datetime.datetime(2015, 7, 27, 10, 10, 0)
    self.assertEqual(600, self.stack.time_elapsed())