def test_constraint_for_scalar_unit(self):
        tpl_snippet = '''
        server:
          type: tosca.my.nodes.Compute
          properties:
            cpu_frequency: 0.05 GHz
            disk_size: 500 MB
            mem_size: 1 MB
        '''
        nodetemplates = yamlparser.simple_parse(tpl_snippet)
        nodetemplate = NodeTemplate('server', nodetemplates, self.custom_def)
        props = nodetemplate.get_properties()
        if 'cpu_frequency' in props.keys():
            error = self.assertRaises(exception.ValidationError,
                                      props['cpu_frequency'].validate)
            self.assertEqual(_('The value "0.05 GHz" of property '
                               '"cpu_frequency" must be greater than or equal '
                               'to "0.1 GHz".'), error.__str__())
        if 'disk_size' in props.keys():
            error = self.assertRaises(exception.ValidationError,
                                      props['disk_size'].validate)
            self.assertEqual(_('The value "500 MB" of property "disk_size" '
                               'must be greater than or equal to "1 GB".'),
                             error.__str__())

        if 'mem_size' in props.keys():
            error = self.assertRaises(exception.ValidationError,
                                      props['mem_size'].validate)
            self.assertEqual(_('The value "1 MB" of property "mem_size" is '
                               'out of range "(min:1 MiB, max:1 GiB)".'),
                             error.__str__())
dataset/ETHPy150Open openstack/tosca-parser/toscaparser/tests/test_scalarunit.py/ScalarUnitNegativeTest.test_constraint_for_scalar_unit/original