def test_module_parameters(self):
        args = dict(
            name='my-snat-translation',
            address='1.1.1.1',
            arp='yes',
            connection_limit=300,
            description='None',
            ip_idle_timeout='50',
            partition='Common',
            state='present',
            traffic_group='test',
            tcp_idle_timeout='20',
            udp_idle_timeout='100',
        )

        p = ModuleParameters(params=args)
        assert p.name == 'my-snat-translation'
        assert p.address == '1.1.1.1'
        assert p.arp == 'enabled'
        assert p.connection_limit == 300
        assert p.description == 'None'
        assert p.ip_idle_timeout == '50'
        assert p.partition == 'Common'
        assert p.state == 'present'
        assert p.traffic_group == '/Common/test'
        assert p.tcp_idle_timeout == '20'
        assert p.udp_idle_timeout == '100'
 def test_module_partition_prefix_parameters(self):
     args = dict(partition='Common',
                 address='10.10.10.10',
                 traffic_group='/Common/traffic-group-1')
     p = ModuleParameters(params=args)
     assert p.partition == 'Common'
     assert p.address == '10.10.10.10'
     assert p.traffic_group == '/Common/traffic-group-1'
 def test_module_parameters_connection_limit_none(self):
     args = dict(connection_limit=0)
     p = ModuleParameters(params=args)
     assert p.connection_limit == 0
 def test_module_parameters_arp_no(self):
     args = dict(arp='no')
     p = ModuleParameters(params=args)
     assert p.arp == 'disabled'
 def test_module_parameters_arp_yes(self):
     args = dict(arp='yes')
     p = ModuleParameters(params=args)
     assert p.arp == 'enabled'
 def test_module_parameters_udp_idle_timeout_string_value(self):
     args = dict(udp_idle_timeout='65000')
     p = ModuleParameters(params=args)
     assert p.udp_idle_timeout == '65000'
 def test_module_parameters_udp_idle_timeout_indefinite(self):
     args = dict(udp_idle_timeout='indefinite')
     p = ModuleParameters(params=args)
     assert p.udp_idle_timeout == 'indefinite'
 def test_module_parameters_state_disabled(self):
     args = dict(state='disabled')
     p = ModuleParameters(params=args)
     assert p.state == 'disabled'
     assert p.disabled is True
 def test_module_parameters_state_absent(self):
     args = dict(state='absent')
     p = ModuleParameters(params=args)
     assert p.state == 'absent'
 def test_module_parameters_state_present(self):
     args = dict(state='present')
     p = ModuleParameters(params=args)
     assert p.state == 'present'
     assert p.enabled is True
 def test_module_parameters_description_string_value(self):
     args = dict(description='My Snat Translation')
     p = ModuleParameters(params=args)
     assert p.description == 'My Snat Translation'
 def test_module_parameters_description_empty(self):
     args = dict(description='')
     p = ModuleParameters(params=args)
     assert p.description == ''