Exemplo n.º 1
0
 def __init__(self):
     """Taxonomy constructor."""
     self.semantic = taxonomy_semantic.TaxonomySemantic()
     self.types = taxonomy_types.TaxonomyTypes()
     self.units = taxonomy_units.TaxonomyUnits()
     self.numeric_types = taxonomy_misc.TaxonomyNumericTypes()
     self.generic_roles = taxonomy_misc.TaxonomyGenericRoles()
     self.ref_parts = taxonomy_misc.TaxonomyRefParts()
Exemplo n.º 2
0
# 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.

import unittest
import taxonomy_types

tax = taxonomy_types.TaxonomyTypes()


class TestTaxonomyTypes(unittest.TestCase):
    def test_get_all_types(self):
        self.assertEqual(len(tax.get_all_types()), 65)

    def test_is_type(self):
        self.assertTrue(
            tax.is_type("solar-types:systemAvailabilityModeItemType"))
        self.assertTrue(tax.is_type("solar-types:deviceItemType"))
        self.assertTrue(tax.is_type("solar-types:insuranceItemType"))
        self.assertFalse(tax.is_type("solar:insuranceItemType"))
        self.assertFalse(tax.is_type("insuranceItemType"))
        self.assertFalse(
            tax.is_type("solar-types:systemAvailabilityMoeItemType"))
Exemplo n.º 3
0
 def __init__(self):
     self.semantic = taxonomy_semantic.TaxonomySemantic()
     self.types = taxonomy_types.TaxonomyTypes()
     self.units = taxonomy_units.TaxonomyUnits()
     self.misc = taxonomy_misc.TaxonomyMisc()
Exemplo n.º 4
0
 def __init__(self):
     """Taxonomy constructor."""
     self.semantic = taxonomy_semantic.TaxonomySemantic()
     self.types = taxonomy_types.TaxonomyTypes()
     self.units = taxonomy_units.TaxonomyUnits()
     self.misc = taxonomy_misc.TaxonomyMisc()