[Python-modules-commits] [pyeapi] 08/12: tests: fix test case when random is a valid VLAN

Vincent Bernat bernat at moszumanska.debian.org
Sun Sep 25 15:45:46 UTC 2016


This is an automated email from the git hooks/post-receive script.

bernat pushed a commit to branch master
in repository pyeapi.

commit 272866776820111a8d018f2630f50a4f9a9f9bcb
Author: Vincent Bernat <vincent at bernat.im>
Date:   Sun Sep 25 17:37:16 2016 +0200

    tests: fix test case when random is a valid VLAN
    
    A random string (like '214') can be a valid VLAN. Fix the test case such
    that the not-so-random string can never be a VLAN.
    
    Closes: #838828.
    Forwarded: https://github.com/arista-eosplus/pyeapi/pull/109
---
 test/unit/test_api_vlans.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/unit/test_api_vlans.py b/test/unit/test_api_vlans.py
index 3849e68..7652ec9 100644
--- a/test/unit/test_api_vlans.py
+++ b/test/unit/test_api_vlans.py
@@ -49,7 +49,7 @@ class TestApiVlans(EapiConfigUnitTest):
         self.config = open(get_fixture('running_config.text')).read()
 
     def test_isvlan_with_string(self):
-        self.assertFalse(pyeapi.api.vlans.isvlan(random_string()))
+        self.assertFalse(pyeapi.api.vlans.isvlan('a' + random_string()))
 
     def test_isvlan_valid_value(self):
         self.assertTrue(pyeapi.api.vlans.isvlan('1234'))

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/pyeapi.git



More information about the Python-modules-commits mailing list