本文整理汇总了Python中hap2_ceilometer.Common类的典型用法代码示例。如果您正苦于以下问题:Python Common类的具体用法?Python Common怎么用?Python Common使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Common类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, options={}):
Common.__init__(self)
self.__options = options
self.store = {}
# replace a lower layer method
self._Common__request = self.__request
示例2: test_parse_time_without_micro
def test_parse_time_without_micro(self):
actual = Common.parse_time("2014-09-05T06:25:29")
expect = datetime(2014, 9, 5, 6, 25, 29)
self.assertEqual(actual, expect)
示例3: __assert
def __assert(self, status, expect):
self.assertEquals(Common.status_to_hapi_event_type(status), expect)
示例4: test_alarm_to_hapi_status_creation
def test_alarm_to_hapi_status_creation(self):
alarm_type = "creation"
detail = '{"state": "ok"}'
evt_type = Common.alarm_to_hapi_status(alarm_type, detail)
self.assertEqual(evt_type, "OK")
示例5: test_alarm_to_hapi_status_unknown
def test_alarm_to_hapi_status_unknown(self):
alarm_type = "state transition"
detail = '{"state": "insufficient data"}'
evt_type = Common.alarm_to_hapi_status(alarm_type, detail)
self.assertEqual(evt_type, "UNKNOWN")
示例6: test_alarm_to_hapi_status_ng
def test_alarm_to_hapi_status_ng(self):
alarm_type = "state transition"
detail = '{"state": "alarm"}'
evt_type = Common.alarm_to_hapi_status(alarm_type, detail)
self.assertEqual(evt_type, "NG")
示例7: test_hapi_time_to_url_enc_openstack_time_with_dot_only
def test_hapi_time_to_url_enc_openstack_time_with_dot_only(self):
hapi_time = "20150624081005."
actual = Common.hapi_time_to_url_enc_openstack_time(hapi_time)
expect = "2015-06-24T08%3A10%3A05.000000"
self.assertEqual(actual, expect)
示例8: test_hapi_time_to_url_enc_openstack_time_with_ns
def test_hapi_time_to_url_enc_openstack_time_with_ns(self):
hapi_time = "20150624081005.123456789"
actual = Common.hapi_time_to_url_enc_openstack_time(hapi_time)
expect = "2015-06-24T08%3A10%3A05.123456"
self.assertEqual(actual, expect)