# Path: collectors/lib/docker_engine/stats.py
# class Stats(object):
#     def __init__(self, container, mtime):
#         self.dims = [
#             "container_name=%s" % self.trim_container_name(container),
#             "container_id=%s" % container['Id'],
#             "image_name=%s" % container['Image'],
#             "image_id=%s" % container['ImageID']
#         ]
#         self.event_time = mtime
# 
#     @staticmethod
#     def trim_container_name(container):
#         return container["Names"][0].strip("/")


import unittest
import time
from collectors.lib.docker_engine.stats import Stats
#!/usr/bin/env python
# This file is part of tcollector.
# Copyright (C) 2010-2013  The tcollector Authors.
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
# option) any later version.  This program is distributed in the hope that it
# will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser
# General Public License for more details.  You should have received a copy
# of the GNU Lesser General Public License along with this program.  If not,
# see <http://www.gnu.org/licenses/>.





class TestStats(unittest.TestCase):
    def setUp(self):
        self.now = time.gmtime()
        self.container = {
            "Names": ["/name"],
            "Id": "cntHASH",
            "Image": "qnib/test",

# Path: collectors/lib/docker_engine/stats.py
# class Stats(object):
#     def __init__(self, container, mtime):
#         self.dims = [
#             "container_name=%s" % self.trim_container_name(container),
#             "container_id=%s" % container['Id'],
#             "image_name=%s" % container['Image'],
#             "image_id=%s" % container['ImageID']
#         ]
#         self.event_time = mtime
# 
#     @staticmethod
#     def trim_container_name(container):
#         return container["Names"][0].strip("/")


# Path: collectors/test/docker_engine/test_stats.py
import unittest
import time
from collectors.lib.docker_engine.stats import Stats

#!/usr/bin/env python
# This file is part of tcollector.
# Copyright (C) 2010-2013  The tcollector Authors.
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
# option) any later version.  This program is distributed in the hope that it
# will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser
# General Public License for more details.  You should have received a copy
# of the GNU Lesser General Public License along with this program.  If not,
# see <http://www.gnu.org/licenses/>.





class TestStats(unittest.TestCase):
    def setUp(self):
        self.now = time.gmtime()
        self.container = {
            "Names": ["/name"],
            "Id": "cntHASH",
            "Image": "qnib/test",

            "ImageID": "sha256:123"