Skip to content

Commit

Permalink
Add negate case to unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
phil-dileo committed Sep 16, 2015
1 parent 535de13 commit fe4fe20
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions test/unit/test_api_bgp.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,23 +99,29 @@ def test_set_router_id(self):
self.eapi_positive_config_test(func, cmds)

def test_maximum_paths_just_max_path(self):
for state in ['config', 'default']:
for state in ['config', 'negate', 'default']:
max_paths = 20
if state == 'config':
cmds = ['router bgp 65000', 'maximum-paths 20']
func = function('set_maximum_paths', max_paths)
elif state == 'negate':
cmds = ['router bgp 65000', 'no maximum-paths']
func = function('set_maximum_paths')
elif state == 'default':
cmds = ['router bgp 65000', 'default maximum-paths']
func = function('set_maximum_paths', default=True)
self.eapi_positive_config_test(func, cmds)

def test_maximum_paths_max_path_and_ecmp(self):
for state in ['config', 'default']:
for state in ['config', 'negate', 'default']:
max_paths = 20
max_ecmp_path = 20
if state == 'config':
cmds = ['router bgp 65000', 'maximum-paths 20 ecmp 20']
func = function('set_maximum_paths', max_paths, max_ecmp_path)
elif state == 'negate':
cmds = ['router bgp 65000', 'no maximum-paths']
func = function('set_maximum_paths')
elif state == 'default':
cmds = ['router bgp 65000', 'default maximum-paths']
func = function('set_maximum_paths', default=True)
Expand Down

0 comments on commit fe4fe20

Please sign in to comment.