<commit_before>#
# Copyright (c) 2015, Open-RnD Sp. z o.o.  All rights reserved.
#
"""System parameters wrappers"""

from __future__ import absolute_import

import unittest
import mock

from ros3ddevcontroller.param.parameter import Parameter, ReadOnlyParameter, ParameterStatus

class ParameterTestCase(unittest.TestCase):
    def test_new_no_status(self):
        par = Parameter('foo', 'bar', str)

        self.assertEqual(par.name, 'foo')
        self.assertEqual(par.value, 'bar')
        self.assertIsInstance(par.value, str)
        self.assertEqual(par.value_type, str)

        self.assertTrue(hasattr(par, 'status'))
        status = par.status
        self.assertIsInstance(status, ParameterStatus)
        self.assertEqual(status.read, True)
        self.assertEqual(status.write, True)
        self.assertEqual(status.status, ParameterStatus.HARDWARE)

    def test_new_status(self):
        st = ParameterStatus()<commit_msg>tests/parameter: default parameter status type was changed<commit_after>#
# Copyright (c) 2015, Open-RnD Sp. z o.o.  All rights reserved.
#
"""System parameters wrappers"""

from __future__ import absolute_import

import unittest
import mock

from ros3ddevcontroller.param.parameter import Parameter, ReadOnlyParameter, ParameterStatus

class ParameterTestCase(unittest.TestCase):
    def test_new_no_status(self):
        par = Parameter('foo', 'bar', str)

        self.assertEqual(par.name, 'foo')
        self.assertEqual(par.value, 'bar')
        self.assertIsInstance(par.value, str)
        self.assertEqual(par.value_type, str)

        self.assertTrue(hasattr(par, 'status'))
        status = par.status
        self.assertIsInstance(status, ParameterStatus)
        self.assertEqual(status.read, True)
        self.assertEqual(status.write, True)
        self.assertEqual(status.status, ParameterStatus.SOFTWARE)

    def test_new_status(self):
        st = ParameterStatus()
{'fraction_non_alphanumeric': 0.10493506493506494, 'fraction_numerical': 0.005194805194805195, 'mean_word_length': 3.674757281553398, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '206512', 'n_tokens_mistral': 557, 'n_tokens_neox': 544, 'n_words': 125}