forked from google/or-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_routing_api.py
92 lines (69 loc) · 2.72 KB
/
test_routing_api.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
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# Various calls to CP api from python to verify they work.
'''Test routing API'''
from __future__ import print_function
import types
import unittest
from ortools.constraint_solver import pywrapcp
class TestIntVarContainerAPI(unittest.TestCase):
def test_contains(self):
self.assertTrue(
hasattr(pywrapcp.IntVarContainer, 'Contains'),
dir(pywrapcp.IntVarContainer))
def test_element(self):
self.assertTrue(
hasattr(pywrapcp.IntVarContainer, 'Element'),
dir(pywrapcp.IntVarContainer))
def test_size(self):
self.assertTrue(
hasattr(pywrapcp.IntVarContainer, 'Size'), dir(pywrapcp.IntVarContainer))
def test_store(self):
self.assertTrue(
hasattr(pywrapcp.IntVarContainer, 'Store'), dir(pywrapcp.IntVarContainer))
def test_restore(self):
self.assertTrue(
hasattr(pywrapcp.IntVarContainer, 'Restore'),
dir(pywrapcp.IntVarContainer))
class TestIntervalVarContainerAPI(unittest.TestCase):
def test_contains(self):
self.assertTrue(
hasattr(pywrapcp.IntervalVarContainer, 'Contains'),
dir(pywrapcp.IntervalVarContainer))
def test_element(self):
self.assertTrue(
hasattr(pywrapcp.IntervalVarContainer, 'Element'),
dir(pywrapcp.IntervalVarContainer))
def test_size(self):
self.assertTrue(
hasattr(pywrapcp.IntervalVarContainer, 'Size'),
dir(pywrapcp.IntervalVarContainer))
def test_store(self):
self.assertTrue(
hasattr(pywrapcp.IntervalVarContainer, 'Store'),
dir(pywrapcp.IntervalVarContainer))
def test_restore(self):
self.assertTrue(
hasattr(pywrapcp.IntervalVarContainer, 'Restore'),
dir(pywrapcp.IntervalVarContainer))
class TestSequenceVarContainerAPI(unittest.TestCase):
def test_contains(self):
self.assertTrue(
hasattr(pywrapcp.SequenceVarContainer, 'Contains'),
dir(pywrapcp.SequenceVarContainer))
def test_element(self):
self.assertTrue(
hasattr(pywrapcp.SequenceVarContainer, 'Element'),
dir(pywrapcp.SequenceVarContainer))
def test_size(self):
self.assertTrue(
hasattr(pywrapcp.SequenceVarContainer, 'Size'),
dir(pywrapcp.SequenceVarContainer))
def test_store(self):
self.assertTrue(
hasattr(pywrapcp.SequenceVarContainer, 'Store'),
dir(pywrapcp.SequenceVarContainer))
def test_restore(self):
self.assertTrue(
hasattr(pywrapcp.SequenceVarContainer, 'Restore'),
dir(pywrapcp.SequenceVarContainer))
if __name__ == '__main__':
unittest.main()