test_column_insert_remove.py
1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#! /usr/bin/env python
from gammalib import *
def test_one(a):
a[0] = 1
a[1] = 2
a[2] = 3
print a
return a
def test_two(a):
a.remove(0, 0)
a.remove(0, 1)
a.insert(0, 2)
a.remove(1, 2)
a.remove(1, 1)
a.remove(0, 1)
print a
return a
def test_three(a):
a.insert(0, 10)
print a
a[7] = 99
a.remove(8, 2)
a[0] = 99
a.remove(1, 5)
print a
return a
def set(a):
# a[0] = 1.0
a[1] = 65536
a[2] = True
# a[3] = "Hallo"
print a[1]
#==========================#
# Main routine entry point #
#==========================#
if __name__ == '__main__':
"""
Perform testing.
"""
# Perform tests
# a = GFitsTableBitCol("Test",4)
# a = GFitsTableBoolCol("Test",4)
# a = GFitsTableByteCol("Test",4)
# a = GFitsTableDoubleCol("Test",4)
# a = GFitsTableFloatCol("Test",4)
# a = GFitsTableLongCol("Test",4)
# a = GFitsTableLongLongCol("Test",4)
# a = GFitsTableShortCol("Test",4)
# a = GFitsTableStringCol("Test",4,10)
# a = GFitsTableULongCol("Test",4)
a = GFitsTableUShortCol("Test", 4)
a = test_one(a)
a = test_two(a)
a = test_three(a)
# set(a)