<commit_before>import unittest
import datafilereader
from robotide.controller.commands import ChangeCellValue, DeleteRows
from robot.utils.asserts import assert_equals, assert_true, assert_false,\
    assert_none
from robotide.controller.cellinfo import CellType, ContentType, CellInfo,\
    CellContent, CellPosition

class TestCellInfoErrors(unittest.TestCase):

    def test_empty_mandatory_is_error(self):
        assert_true(CellInfo(CellContent(ContentType.EMPTY, '', ''), CellPosition(CellType.MANDATORY, None)).has_error())

    def test_none_empty_mandatory_is_not_error(self):
        assert_false(CellInfo(CellContent(ContentType.LIBRARY_KEYWORD, '', ''), CellPosition(CellType.MANDATORY, None)).has_error())

    def test_commented_mandatory_is_error(self):
        assert_true(CellInfo(CellContent(ContentType.COMMENTED, '', ''), CellPosition(CellType.MANDATORY, None)).has_error())

    def test_none_empty_mandatory_empty_is_error(self):
        assert_true(CellInfo(CellContent(ContentType.STRING, '', ''), CellPosition(CellType.MUST_BE_EMPTY, None)).has_error())

    def test_empty_mandatory_empty_is_not_error(self):
        assert_false(CellInfo(CellContent(ContentType.EMPTY, '', ''), CellPosition(CellType.MUST_BE_EMPTY, None)).has_error())

    def test_optional_has_no_error(self):
        assert_false(CellInfo(CellContent(ContentType.EMPTY, '', ''), CellPosition(CellType.OPTIONAL, None)).has_error())
        assert_false(CellInfo(CellContent(ContentType.STRING, '', ''), CellPosition(CellType.OPTIONAL, None)).has_error())


class TestCellInfo(unittest.TestCase):

    @classmethod
    def setUpClass(cls):
        ctrl = datafilereader.construct_chief_controller(datafilereader.ARGUMENTS_PATH)
        testsuite = datafilereader.get_ctrl_by_name('Suite', ctrl.datafiles)
        cls.test = testsuite.tests[0]<commit_msg>tests for CellInfo.too_many__arguments() and .arguments_missing()<commit_after>import unittest
import datafilereader
from robotide.controller.commands import ChangeCellValue, DeleteRows
from robot.utils.asserts import assert_equals, assert_true, assert_false,\
    assert_none
from robotide.controller.cellinfo import CellType, ContentType, CellInfo,\
    CellContent, CellPosition

class TestCellInfoErrors(unittest.TestCase):

    def test_empty_mandatory_is_error(self):
        cell = CellInfo(CellContent(ContentType.EMPTY, '', ''), CellPosition(CellType.MANDATORY, None))
        assert_true(cell.has_error())
        assert_true(cell.argument_missing())

    def test_none_empty_mandatory_is_not_error(self):
        cell = CellInfo(CellContent(ContentType.LIBRARY_KEYWORD, '', ''), CellPosition(CellType.MANDATORY, None))
        assert_false(cell.has_error())
        assert_false(cell.argument_missing())

    def test_commented_mandatory_is_error(self):
        cell = CellInfo(CellContent(ContentType.COMMENTED, '', ''), CellPosition(CellType.MANDATORY, None))
        assert_true(cell.has_error())
        assert_true(cell.argument_missing())

    def test_none_empty_mandatory_empty_is_error(self):
        cell = CellInfo(CellContent(ContentType.STRING, '', ''), CellPosition(CellType.MUST_BE_EMPTY, None))
        assert_true(cell.has_error())
        assert_true(cell.too_many_arguments())

    def test_empty_mandatory_empty_is_not_error(self):
        cell = CellInfo(CellContent(ContentType.EMPTY, '', ''), CellPosition(CellType.MUST_BE_EMPTY, None))
        assert_false(cell.has_error())
        assert_false(cell.too_many_arguments())

    def test_optional_has_no_error(self):
        assert_false(CellInfo(CellContent(ContentType.EMPTY, '', ''), CellPosition(CellType.OPTIONAL, None)).has_error())
        assert_false(CellInfo(CellContent(ContentType.STRING, '', ''), CellPosition(CellType.OPTIONAL, None)).has_error())


class TestCellInfo(unittest.TestCase):

    @classmethod
    def setUpClass(cls):
        ctrl = datafilereader.construct_chief_controller(datafilereader.ARGUMENTS_PATH)
        testsuite = datafilereader.get_ctrl_by_name('Suite', ctrl.datafiles)
        cls.test = testsuite.tests[0]
{'fraction_non_alphanumeric': 0.11369762313158539, 'fraction_numerical': 0.000490075961774075, 'mean_word_length': 5.583870967741936, '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': '7371134', 'n_tokens_mistral': 1250, 'n_tokens_neox': 1235, 'n_words': 160}