-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathtest_init.py
38 lines (30 loc) · 1.22 KB
/
test_init.py
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
# -*- coding: UTF-8 -*-
try:
import unittest2 as unittest
except:
import unittest
from args import ARGS
import oerplib
class TestInit(unittest.TestCase):
def test_init1(self):
# Server + Database + Protocol + Port
oerp = oerplib.OERP(ARGS.server, ARGS.database,
ARGS.protocol, ARGS.port)
self.assertIsInstance(oerp, oerplib.OERP)
self.assertIsNotNone(oerp)
self.assertEqual(oerp.server, ARGS.server)
self.assertEqual(oerp.database, ARGS.database)
self.assertEqual(oerp.protocol, ARGS.protocol)
self.assertEqual(oerp.port, ARGS.port)
def test_init2(self):
# Server + Database + Protocol + Port + Timeout
oerp = oerplib.OERP(ARGS.server, ARGS.database,
ARGS.protocol, ARGS.port, 42)
self.assertIsInstance(oerp, oerplib.OERP)
self.assertIsNotNone(oerp)
self.assertEqual(oerp.server, ARGS.server)
self.assertEqual(oerp.database, ARGS.database)
self.assertEqual(oerp.protocol, ARGS.protocol)
self.assertEqual(oerp.port, ARGS.port)
self.assertEqual(oerp.config['timeout'], 42)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: