def test_do_associate(self, mocked_pulp, bargs): bargs = bargs.split(" ") bopts = testbOpts() p = testPulp() mocked_pulp.side_effect = [p] if len(bargs) != 2: with pytest.raises(SystemExit): cli.do_associate(bopts, bargs) else: assert cli.do_associate(bopts, bargs) is None
def test_do_associate(self, bargs): bargs = bargs.split(" ") bopts = testbOpts() p = testPulp() (flexmock(Pulp).new_instances(p).with_args( Pulp, env=bopts.server, config_file=bopts.config_file)) if len(bargs) != 2: with pytest.raises(SystemExit): cli.do_associate(bopts, bargs) else: assert cli.do_associate(bopts, bargs) is None
def test_do_associate(self, bargs): bargs = bargs.split(" ") bopts = testbOpts() p = testPulp() (flexmock(Pulp) .new_instances(p) .with_args(Pulp, env=bopts.server, config_file=bopts.config_file)) if len(bargs) != 2: with pytest.raises(SystemExit): cli.do_associate(bopts, bargs) else: assert cli.do_associate(bopts, bargs) is None