Пример #1
0
    def test_badtype_parsing(self):
        """Test parsing wrong type of attribute from their value."""
        ofile = open(test3)
        rel, attrs = read_header(ofile)

        for name, value in attrs:
            try:
                parse_type(value)
                raise Error("Could parse type of crap, should not happen.")
            except ParseArffError:
                pass
Пример #2
0
    def test_badtype_parsing(self):
        """Test parsing wrong type of attribute from their value."""
        ofile = open(test3)
        rel, attrs = read_header(ofile)

        for name, value in attrs:
            try:
                parse_type(value)
                raise Error("Could parse type of crap, should not happen.")
            except ParseArffError:
                pass
Пример #3
0
    def test_type_parsing(self):
        """Test parsing type of attribute from their value."""
        ofile = open(test2)
        rel, attrs = read_header(ofile)

        expected = ['numeric', 'numeric', 'numeric', 'numeric', 'numeric',
                    'numeric', 'string', 'string', 'nominal', 'nominal']

        for i in range(len(attrs)):
            assert parse_type(attrs[i][1]) == expected[i]
Пример #4
0
    def test_type_parsing(self):
        """Test parsing type of attribute from their value."""
        ofile = open(test2)
        rel, attrs = read_header(ofile)

        expected = ['numeric', 'numeric', 'numeric', 'numeric', 'numeric',
                    'numeric', 'string', 'string', 'nominal', 'nominal']

        for i in range(len(attrs)):
            assert_(parse_type(attrs[i][1]) == expected[i])
Пример #5
0
    def test_type_parsing(self):
        # Test parsing type of attribute from their value.
        ofile = open(test2)
        rel, attrs = read_header(ofile)
        ofile.close()

        expected = [
            "numeric",
            "numeric",
            "numeric",
            "numeric",
            "numeric",
            "numeric",
            "string",
            "string",
            "nominal",
            "nominal",
        ]

        for i in range(len(attrs)):
            assert_(parse_type(attrs[i][1]) == expected[i])