Changeset 6608


Ignore:
Timestamp:
Jan 15, 2009, 11:23:22 PM (17 years ago)
Author:
roland
Message:

More unittest updates, and one bug fix in wllogic.py.

Location:
trunk/exodus
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/exodus/tests/test_forms.py

    r6607 r6608  
     1import unittest
     2
     3from exodus.tests.base import BootstrapTestCase
     4
     5class FormsTest(BootstrapTestCase):
     6    pass
     7
     8def suite():
     9    s = unittest.TestSuite()
     10    s.addTest(unittest.makeSuite(FormsTest))
     11    return s
  • trunk/exodus/tests/test_wlipcalc.py

    r6606 r6608  
     1import unittest
    12from exodus.tests.base import BootstrapTestCase
    23
     
    7374
    7475        self.failUnlessEqual(ipcalc.ips, ip_list)
     76
     77def suite():
     78    s = unittest.TestSuite()
     79    s.addTest(unittest.makeSuite(IPCalcTest))
     80    return s
  • trunk/exodus/tests/test_wllogic.py

    r6607 r6608  
    66    def test_get_direction_choices(self):
    77        from exodus.wllogic import get_direction_choices as gdc
     8        self.failUnlessEqual(gdc('n'), 'north')
    89        self.failUnlessEqual(gdc('nw'), 'north-west')
    9         self.failUnlessEqual(gdc('n'), 'north')
     10        self.failUnlessEqual(gdc('w'), 'west')
     11        self.failUnlessEqual(gdc('sw'), 'south-west')
     12        self.failUnlessEqual(gdc('s'), 'south')
     13        self.failUnlessEqual(gdc('se'), 'south-east')
     14        self.failUnlessEqual(gdc('e'), 'east')
     15        self.failUnlessEqual(gdc('ne'), 'north-east')
     16        self.failUnlessEqual(gdc('omni'), 'omnidirectional')
    1017
    11     def test_new_ssid_for_(self):
    12         class nic(object):
    13             iface = 'ath0'     
    14             class node(object):
    15                 name = 'CeTIM'
    16                 class network(object):
    17                     name = 'wleiden.net'
     18    def test_new_ssid(self):
     19        #XXX: need to test 'ap', direction and multiple aps on one node.
     20        class node(object):
     21            name = 'CeTIM'
     22        class network(object):
     23            name = 'wleiden.net'
    1824        from exodus.wllogic import new_ssid
    19         ssid = new_ssid(nic())       
     25        ssid = new_ssid(network(), node(), 'ath0')       
    2026       
    2127        self.failUnlessEqual(ssid, 'ath0.CeTIM.wleiden.net')
     28
     29    def test_new_ssid_for_existing_interface(self):
     30        self.fail('Not yet implemented')
    2231
    2332    def test_parse_show_addr(self):
     
    95104        ip = free_master_ip(network)
    96105        self.failIf(ip in ip_list)
    97         self.failUnlessEqual(ip, '172.16.2.1')
     106        self.failUnlessEqual(ip, '172.16.3.1')
    98107
    99108    def test_calc_subnet(self):
     
    182191    s = unittest.TestSuite()
    183192    s.addTest(unittest.makeSuite(WLLogic))
     193    s.addTest(unittest.makeSuite(Link))
    184194
    185195    return s
  • trunk/exodus/wllogic.py

    r6513 r6608  
    1919def new_ssid_for_existing_interface(nic):
    2020    """A parser that can be called in an easier way than new_ssid."""
    21     return new_ssid(nic.network,nic.node, nic.iface, nic.accesspoint,
    22             nic.get_direction_dislay())
     21    return new_ssid(nic.node.network,nic.node, nic.iface, nic.accesspoint,
     22            nic.get_direction_display())
    2323
    2424def new_ssid(network, node, iface, accesspoint=False, direction=None):
Note: See TracChangeset for help on using the changeset viewer.