source: devel/test_attropl.py @ 327

Last change on this file since 327 was 309, checked in by bas, 10 years ago

Checkin the pbs swig development files

  • Property svn:executable set to *
File size: 1.3 KB
RevLine 
[309]1#!/usr/bin/python
2#
3import sys
4import pbs
5
6def test_init():
7  print 'Test init'
8  t = pbs.new_attropl(1)
9  print type(t)
10  print str(t)
11
12  w = pbs.new_attropl(2)
13  print type(w)
14
15def test_getitem():
16  print 'Test getitem'
17  w = pbs.new_attropl(2)
18  b = w[0]
19  c = w[1]
20
21  b.name = 'bas'
22  b.value = 'vlies'
23  b.op = pbs.INCR;
24  print type(b)
25  print 'b', str(b)
26
27  c.name = 'cbassssssssssss'
28  c.value = 'cvlies'
29  c.op = pbs.DECR
30  print type(c)
31  print 'c', str(c), repr(c)
32
33def test_loop():
34  print 'Loop'
35  w = pbs.new_attropl(2)
36  w[0].name = 'bas'
37  w[0].value = 'man'
38
39  w[1].name = 'jaap'
40  w[1].value = 'man'
41
42  for i in w:
43    print i.name
44
45
46test_init()
47test_getitem()
48test_loop()
49
50print "Testing"
51pbs_server = pbs.pbs_default()
52con = pbs.pbs_connect(pbs_server)
53
54z = pbs.new_attropl(2)
55z[0].name = pbs.ATTR_u
56z[0].value = 'a403vink,zuidema'
57z[0].op = pbs.EQ
58
59z[1].name = pbs.ATTR_N
60z[1].value = 'runRollCV'
61z[1].op = pbs.EQ
62
63q = pbs.new_attropl(1)
64q[0].name = pbs.ATTR_u
65q[0].value = 'zuidema'
66q[0].op = pbs.EQ
67
68
69combine = z + q
70jobs = pbs.pbs_selectjob(con, z, "NULL")
71
72print type(jobs)
73for i in jobs:
74  print i
75
76
77#print 'bla'
78#print pbs.ptrvalue(jobs,0)
79#if pbs.ptrvalue(jobs,0) == 'NULL':
80#  print 'yes'
81#  sys.exit(1)
82#print pbs.ptrvalue(jobs,1)
83#print pbs.ptrvalue(jobs,2)
84#print pbs.ptrvalue(jobs,3)
85
Note: See TracBrowser for help on using the repository browser.