File: test.py

package info (click to toggle)
rdkit 202503.1-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 220,160 kB
  • sloc: cpp: 399,240; python: 77,453; ansic: 25,517; java: 8,173; javascript: 4,005; sql: 2,389; yacc: 1,565; lex: 1,263; cs: 1,081; makefile: 580; xml: 229; fortran: 183; sh: 105
file content (61 lines) | stat: -rwxr-xr-x 1,375 bytes parent folder | download | duplicates (2)
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
# Copyright Rational Discovery LLC 2005
# Distributed under the Boost Software License, Version 1.0. (See
# accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
import unittest

import SPtrTestModule as TestModule


class TestCase(unittest.TestCase):

  def setUp(self):
    pass

  def test1(self):
    obj = TestModule.DemoKlass(3)
    self.assertTrue(obj.GetVal() == 3)

  def test2(self):
    obj = TestModule.buildPtr(3)
    self.assertTrue(obj.GetVal() == 3)

  def test3(self):
    obj = TestModule.buildSPtr(3)
    self.assertTrue(obj.GetVal() == 3)

  def test4(self):
    sz = 5
    vect = TestModule.buildPtrVector(sz)
    self.assertTrue(len(vect) == sz)
    for i in range(sz):
      self.assertTrue(vect[i].GetVal() == i)

  def test5(self):
    sz = 5
    vect = TestModule.buildSPtrVector(sz)
    self.assertTrue(len(vect) == sz)
    for i in range(sz):
      self.assertTrue(vect[i].GetVal() == i)

  def test5b(self):
    sz = 5
    vect = TestModule.buildSPtrVector(sz)
    self.assertTrue(len(vect) == sz)
    p = 0
    for itm in vect:
      self.assertTrue(itm.GetVal() == p)
      p += 1

  def test6(self):
    sz = 5
    cont = TestModule.DemoContainer(sz)
    p = 0
    for itm in cont:
      self.assertTrue(itm.GetVal() == p)
      p += 1
    self.assertTrue(p == sz)


if __name__ == '__main__':
  unittest.main()