Ejemplo n.º 1
0
    def test_args_valid_name_and_component(self):
        """``args_valid`` returns False if supplied with both name and component param"""
        output = addr.args_valid(name='myBox',
                                 addr='',
                                 component='someComponent')

        self.assertFalse(output)
Ejemplo n.º 2
0
    def test_args_valid_component_and_addr(self):
        """``args_valid`` returns False if supplied with both component and addr param"""
        output = addr.args_valid(name=None,
                                 addr='1.2.3.4',
                                 component='someComponent')

        self.assertFalse(output)
Ejemplo n.º 3
0
    def test_args_valid_all_params(self):
        """``args_valid`` returns False if supplied with all params"""
        output = addr.args_valid(name='myBox',
                                 addr='1.2.3.4',
                                 component='someComponent')

        self.assertFalse(output)
Ejemplo n.º 4
0
    def test_args_valid_name_and_addr(self):
        """``args_valid`` returns False if supplied with both name and addr param"""
        output = addr.args_valid(name='myBox', addr='1.2.3.4', component=None)

        self.assertFalse(output)
Ejemplo n.º 5
0
    def test_args_valid_component(self):
        """``args_valid`` returns True if supplied with just the "component" param"""
        output = addr.args_valid(name=None, addr='', component='someComponent')

        self.assertTrue(output)
Ejemplo n.º 6
0
    def test_args_valid_addr(self):
        """``args_valid`` returns True if supplied with just a valid IPv4 param"""
        output = addr.args_valid(name=None, addr='1.2.3.4', component=None)

        self.assertTrue(output)
Ejemplo n.º 7
0
    def test_args_valid_name(self):
        """``args_valid`` returns True if supplied with just the "name" param"""
        output = addr.args_valid(name='someBox', addr=None, component=None)

        self.assertTrue(output)
Ejemplo n.º 8
0
    def test_args_valid_none(self):
        """``args_valid`` a value of None for all args is OK"""
        output = addr.args_valid(name=None, addr=None, component=None)

        self.assertTrue(output)
Ejemplo n.º 9
0
    def test_args_valid_bad_ip(self):
        """``args_valid`` returns False if supplied with an invalid IPv4 address"""
        output = addr.args_valid(name=None, addr='900.2.3.4', component=None)

        self.assertFalse(output)