def test_module_parameters(self): args = dict( name='foo.baz.bar', pool_lb_method='round-robin', ) p = ModuleParameters(params=args) assert p.name == 'foo.baz.bar' assert p.pool_lb_method == 'round-robin'
def test_module_not_fqdn_name(self): args = dict( name='foo', lb_method='round-robin' ) with pytest.raises(F5ModuleError) as excinfo: p = ModuleParameters(params=args) assert p.name == 'foo' assert 'The provided name must be a valid FQDN' in str(excinfo)
def test_module_pools(self): args = dict( pools=[ dict( name='foo', ratio='100' ) ] ) p = ModuleParameters(params=args) assert len(p.pools) == 1