cavis/contrib/attic/pydatavec/tests/test_schema.py

54 lines
2.1 KiB
Python
Raw Normal View History

2021-02-01 06:31:20 +01:00
# /* ******************************************************************************
# *
# *
# * This program and the accompanying materials are made available under the
# * terms of the Apache License, Version 2.0 which is available at
# * https://www.apache.org/licenses/LICENSE-2.0.
# *
2021-02-01 09:47:29 +01:00
# * See the NOTICE file distributed with this work for additional
# * information regarding copyright ownership.
2021-02-01 06:31:20 +01:00
# * 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.
# *
# * SPDX-License-Identifier: Apache-2.0
# ******************************************************************************/
2019-06-06 14:21:15 +02:00
################################################################################
#
# This program and the accompanying materials are made available under the
# terms of the Apache License, Version 2.0 which is available at
# https://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 pytest
from pydatavec import Schema
def test_schema():
schema = Schema()
schema.add_string_column('str1')
schema.add_string_column('str2')
schema.add_integer_column('int1')
schema.add_integer_column('int2')
schema.add_double_column('dbl1')
schema.add_double_column('dbl2')
schema.add_float_column('flt1')
schema.add_float_column('flt2')
schema.add_categorical_column('cat1', ['A', 'B', 'C'])
schema.add_categorical_column('cat2', ['A', 'B', 'C'])
schema.to_java()
if __name__ == '__main__':
pytest.main([__file__])