Merge "Replace oslo_utils.timeutils.isotime"

This commit is contained in:
Jenkins 2016-11-07 14:20:47 +00:00 committed by Gerrit Code Review
commit 64eb60f540
2 changed files with 6 additions and 5 deletions

View File

@ -1717,7 +1717,7 @@ class BasePipelineTestCase(base.BaseTestCase):
for offset in range(2):
counter = copy.copy(self.test_counter)
counter.timestamp = timeutils.isotime(counter_time)
counter.timestamp = datetime.datetime.isoformat(counter_time)
counter.resource_id = resource_id[0]
counter.volume = offset
counter.type = sample.TYPE_CUMULATIVE
@ -1732,13 +1732,13 @@ class BasePipelineTestCase(base.BaseTestCase):
aggregated_counters = aggregator.flush()
self.assertEqual(len(aggregated_counters), 1)
self.assertEqual(aggregated_counters[0].timestamp,
timeutils.isotime(test_time))
datetime.datetime.isoformat(test_time))
rate_of_change_transformer.handle_sample(aggregated_counters[0])
for offset in range(2):
counter = copy.copy(self.test_counter)
counter.timestamp = timeutils.isotime(counter_time)
counter.timestamp = datetime.datetime.isoformat(counter_time)
counter.resource_id = resource_id[offset]
counter.volume = 2
counter.type = sample.TYPE_CUMULATIVE
@ -1758,7 +1758,7 @@ class BasePipelineTestCase(base.BaseTestCase):
rateOfChange = rate_of_change_transformer.handle_sample(
counter)
self.assertEqual(counter.timestamp,
timeutils.isotime(test_time))
datetime.datetime.isoformat(test_time))
self.assertEqual(rateOfChange.volume, 1)

View File

@ -13,6 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import copy
import datetime
from oslo_utils import timeutils
from oslotest import base
@ -109,6 +110,6 @@ class AggregatorTransformerTestCase(base.BaseTestCase):
for _ in range(100):
sample = copy.copy(self.SAMPLE)
sample.resource_id = sample.resource_id + str(self._sample_offset)
sample.timestamp = timeutils.isotime()
sample.timestamp = datetime.datetime.isoformat(timeutils.utcnow())
aggregator.handle_sample(sample)
self._sample_offset += 1