# Path: hardware/generate.py
# def generate(model, prefix=_PREFIX):
#     """Generate a list of dict according to a model.
# 
#     Ipv4 ranges are handled by _generate_ip.
#     """
# 
#     # Safe guard for models without ranges
#     for value in model.values():
#         if type(value) != STRING_TYPE:
#             break
#         elif _RANGE_REGEXP.search(value):
#             break
#     else:
#         return [model]
#     # The model has at least one range starting from here
#     result = []
#     yielded = {}
#     yielded.update(model)
#     yielded_copy = yielded.copy()
#     for key, value in yielded_copy.items():
#         if not prefix or key[0] == prefix:
#             if prefix:
#                 yielded[key[1:]] = _generate_values(value, prefix)
#                 del yielded[key]
#             else:
#                 if isinstance(value, str) and not _RANGE_REGEXP.search(value):
#                     yielded[key] = value
#                 else:
#                     yielded[key] = _generate_values(value, prefix)
#         else:
#             yielded[key] = value
#     while True:
#         try:
#             result.append(_call_nexts(yielded))
#         except StopIteration:
#             break
#     return result


from collections import OrderedDict
from hardware import generate
import unittest
# Copyright (C) 2014 eNovance SAS <licensing@enovance.com>
#
# 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.




class TestGenerate(unittest.TestCase):

    def test_is_included_same(self):
        a = {'a': 1}

# Path: hardware/generate.py
# def generate(model, prefix=_PREFIX):
#     """Generate a list of dict according to a model.
# 
#     Ipv4 ranges are handled by _generate_ip.
#     """
# 
#     # Safe guard for models without ranges
#     for value in model.values():
#         if type(value) != STRING_TYPE:
#             break
#         elif _RANGE_REGEXP.search(value):
#             break
#     else:
#         return [model]
#     # The model has at least one range starting from here
#     result = []
#     yielded = {}
#     yielded.update(model)
#     yielded_copy = yielded.copy()
#     for key, value in yielded_copy.items():
#         if not prefix or key[0] == prefix:
#             if prefix:
#                 yielded[key[1:]] = _generate_values(value, prefix)
#                 del yielded[key]
#             else:
#                 if isinstance(value, str) and not _RANGE_REGEXP.search(value):
#                     yielded[key] = value
#                 else:
#                     yielded[key] = _generate_values(value, prefix)
#         else:
#             yielded[key] = value
#     while True:
#         try:
#             result.append(_call_nexts(yielded))
#         except StopIteration:
#             break
#     return result


# Path: hardware/tests/test_generate.py
from collections import OrderedDict
from hardware import generate
import unittest

# Copyright (C) 2014 eNovance SAS <licensing@enovance.com>
#
# 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.




class TestGenerate(unittest.TestCase):

    def test_is_included_same(self):
        a = {'a': 1}

        self.assertTrue(generate.is_included(a, a))