added tests
parent
9f836cbbb9
commit
081b957b45
|
|
@ -1,4 +1,4 @@
|
|||
from cyclic_utils import CYCLE_LIMIT,rem_routes
|
||||
from cyclic_utils import rem_routes
|
||||
|
||||
class Route(object):
|
||||
"""docstring for Route."""
|
||||
|
|
@ -67,7 +67,8 @@ class Transporter(object):
|
|||
if len(unfulfilled) > 0:
|
||||
print "Contracts from ",repr(unfulfilled)
|
||||
|
||||
def contract_corridors(self):
|
||||
return rem_routes(self.contract_routes())
|
||||
|
||||
|
||||
# Transporter.from_file('./contracts.txt').contracts_required()
|
||||
if __name__ == '__main__':
|
||||
Transporter.from_file('./contracts.txt').contracts_required()
|
||||
|
|
|
|||
|
|
@ -1,14 +1,18 @@
|
|||
import unittest
|
||||
import cyclic_contracts
|
||||
from cyclic_contracts import Transporter
|
||||
|
||||
|
||||
class CyclicTest(unittest.TestCase):
|
||||
"""docstring for CyclicTest."""
|
||||
|
||||
def test_loads():
|
||||
|
||||
|
||||
def test_contract(self):
|
||||
cc = Transporter.from_file("./contracts.txt").contract_corridors()
|
||||
self.assertEqual(cc, [('Mumbai', 'Bangalore')])
|
||||
|
||||
def test_partial(self):
|
||||
cc = Transporter.from_file(
|
||||
"./contracts_partial.txt").contract_corridors()
|
||||
self.assertEqual(cc, [('Mumbai', 'Kolkata'), ('Chennai', 'Kolkata')])
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
|
|
|||
Loading…
Reference in New Issue