deb-ceilometer/ceilometer/tests/constants.py
ZhiQiang Fan 5b8c72c3ea Correct alarm timestamp field in unittest code
This patch corrects some code in unit test which relates to timestamp
issue. timestamp and state_timestamp fields will always be set, but
test code sometimes sets them to None, which will affect source code
to consider the scenario timestamp is None, in fact, this would never
happen in API call.

This patch adds a type check for timestamp and state_timestamp
in alarm.storage.models.Alarm, to prevent contributors to accidently
set these two fields to None.

Change-Id: I035b4f0f9c1ff7f4158c72acfddaf02e55891086
2014-11-07 11:02:39 +08:00

18 lines
669 B
Python

# Copyright 2014 Huawei Technologies Co., Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import datetime
MIN_DATETIME = datetime.datetime(datetime.MINYEAR, 1, 1)