# Path: watcher_dashboard/test/helpers.py
# class WatcherTestsMixin(object):
# class TestCase(WatcherTestsMixin, helpers.TestCase):
# class APITestCase(WatcherTestsMixin, helpers.APITestCase):
# class BaseAdminViewTests(WatcherTestsMixin, helpers.BaseAdminViewTests):
#     def _setup_test_data(self):
#     def setUp(self):
#     def tearDown(self):
#     def stub_watcherclient(self):
# 
# Path: watcher_dashboard/utils/utils.py
# CAMEL_RE = re.compile(r'([A-Z][a-z]+|[A-Z]+(?=[A-Z\s]|$))')
# def de_camel_case(text):
# def list_to_dict(object_list, key_attribute='id'):
# def length(iterator):
# def check_image_type(image, image_type):
# def filter_items(items, **kwargs):
# def safe_int_cast(value):


import collections
from watcher_dashboard.test import helpers
from watcher_dashboard.utils import utils
    def test_de_camel_case(self):
        ret = utils.de_camel_case('CamelCaseString')
        self.assertEqual(ret, 'Camel Case String')
        ret = utils.de_camel_case('SecureSSLConnection')
        self.assertEqual(ret, 'Secure SSL Connection')
        ret = utils.de_camel_case('xxXXxx')
        self.assertEqual(ret, 'xx X Xxx')
        ret = utils.de_camel_case('XXX')
        self.assertEqual(ret, 'XXX')
        ret = utils.de_camel_case('NON Camel Case')
        self.assertEqual(ret, 'NON Camel Case')

    def test_list_to_dict(self):
        Item = collections.namedtuple('Item', 'id')
        ret = utils.list_to_dict([Item('foo'), Item('bar'), Item('bar')])
        self.assertEqual(ret, {'foo': Item('foo'), 'bar': Item('bar')})

    def test_length(self):
        ret = utils.length(iter([]))
        self.assertEqual(ret, 0)
        ret = utils.length(iter([1, 2, 3]))
        self.assertEqual(ret, 3)

    def test_check_image_type(self):
        Image = collections.namedtuple('Image', 'properties')
        ret = utils.check_image_type(Image({'type': 'Picasso'}), 'Picasso')
        self.assertTrue(ret)
        ret = utils.check_image_type(Image({'type': 'Picasso'}), 'Van Gogh')
        self.assertFalse(ret)
        ret = utils.check_image_type(Image({}), 'Van Gogh')

# Path: watcher_dashboard/test/helpers.py
# class WatcherTestsMixin(object):
# class TestCase(WatcherTestsMixin, helpers.TestCase):
# class APITestCase(WatcherTestsMixin, helpers.APITestCase):
# class BaseAdminViewTests(WatcherTestsMixin, helpers.BaseAdminViewTests):
#     def _setup_test_data(self):
#     def setUp(self):
#     def tearDown(self):
#     def stub_watcherclient(self):
# 
# Path: watcher_dashboard/utils/utils.py
# CAMEL_RE = re.compile(r'([A-Z][a-z]+|[A-Z]+(?=[A-Z\s]|$))')
# def de_camel_case(text):
# def list_to_dict(object_list, key_attribute='id'):
# def length(iterator):
# def check_image_type(image, image_type):
# def filter_items(items, **kwargs):
# def safe_int_cast(value):


# Path: watcher_dashboard/utils/tests.py
import collections
from watcher_dashboard.test import helpers
from watcher_dashboard.utils import utils

    def test_de_camel_case(self):
        ret = utils.de_camel_case('CamelCaseString')
        self.assertEqual(ret, 'Camel Case String')
        ret = utils.de_camel_case('SecureSSLConnection')
        self.assertEqual(ret, 'Secure SSL Connection')
        ret = utils.de_camel_case('xxXXxx')
        self.assertEqual(ret, 'xx X Xxx')
        ret = utils.de_camel_case('XXX')
        self.assertEqual(ret, 'XXX')
        ret = utils.de_camel_case('NON Camel Case')
        self.assertEqual(ret, 'NON Camel Case')

    def test_list_to_dict(self):
        Item = collections.namedtuple('Item', 'id')
        ret = utils.list_to_dict([Item('foo'), Item('bar'), Item('bar')])
        self.assertEqual(ret, {'foo': Item('foo'), 'bar': Item('bar')})

    def test_length(self):
        ret = utils.length(iter([]))
        self.assertEqual(ret, 0)
        ret = utils.length(iter([1, 2, 3]))
        self.assertEqual(ret, 3)

    def test_check_image_type(self):
        Image = collections.namedtuple('Image', 'properties')
        ret = utils.check_image_type(Image({'type': 'Picasso'}), 'Picasso')
        self.assertTrue(ret)
        ret = utils.check_image_type(Image({'type': 'Picasso'}), 'Van Gogh')
        self.assertFalse(ret)
        ret = utils.check_image_type(Image({}), 'Van Gogh')

        self.assertTrue(ret)