File: test_database_types.py

package info (click to toggle)
python-datacache 1.4.1-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 284 kB
  • sloc: python: 935; sh: 14; makefile: 4
file content (14 lines) | stat: -rw-r--r-- 406 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import numpy as np
from datacache.database_types import db_type

def test_db_types():
    for int_type in [
            int,
            np.int8, np.int16, np.int32, np.int64,
            np.uint8, np.uint16, np.uint32, np.uint64]:
        assert db_type(int_type) == "INT"

    for float_type in [float, np.float32, np.float64]:
        assert db_type(float) == "FLOAT"

    assert db_type(str) == "TEXT"