Remove no-op flags from the ansible-galaxy unit tests

pull/84246/head
s-hertel 3 weeks ago
parent e220fc0fe2
commit 73abe43d7e

@ -64,7 +64,7 @@ class TestGalaxy(unittest.TestCase):
shutil.rmtree("./delete_me", ignore_errors=True) shutil.rmtree("./delete_me", ignore_errors=True)
# creating framework for a role # creating framework for a role
gc = GalaxyCLI(args=["ansible-galaxy", "init", "--offline", "delete_me"]) gc = GalaxyCLI(args=["ansible-galaxy", "init", "delete_me"])
gc.run() gc.run()
cls.role_dir = "./delete_me" cls.role_dir = "./delete_me"
cls.role_name = "delete_me" cls.role_name = "delete_me"
@ -215,7 +215,6 @@ class TestGalaxy(unittest.TestCase):
""" testing the options parser when the action 'init' is given """ """ testing the options parser when the action 'init' is given """
gc = GalaxyCLI(args=["ansible-galaxy", "init", "foo"]) gc = GalaxyCLI(args=["ansible-galaxy", "init", "foo"])
gc.parse() gc.parse()
assert not context.CLIARGS['offline']
assert not context.CLIARGS['force'] assert not context.CLIARGS['force']
def test_parse_install(self): def test_parse_install(self):
@ -279,7 +278,7 @@ class ValidRoleTests(object):
args = ['ansible-galaxy'] args = ['ansible-galaxy']
if use_explicit_type: if use_explicit_type:
args += ['role'] args += ['role']
args += ['init', '-c', '--offline'] + galaxy_args + ['--init-path', cls.test_dir, cls.role_name] args += ['init'] + galaxy_args + ['--init-path', cls.test_dir, cls.role_name]
gc = GalaxyCLI(args=args) gc = GalaxyCLI(args=args)
gc.run() gc.run()
@ -480,7 +479,7 @@ def test_verbosity_arguments(cli_args, expected, monkeypatch):
def collection_skeleton(request, tmp_path_factory): def collection_skeleton(request, tmp_path_factory):
name, skeleton_path = request.param name, skeleton_path = request.param
galaxy_args = ['ansible-galaxy', 'collection', 'init', '-c'] galaxy_args = ['ansible-galaxy', 'collection', 'init']
if skeleton_path is not None: if skeleton_path is not None:
galaxy_args += ['--collection-skeleton', skeleton_path] galaxy_args += ['--collection-skeleton', skeleton_path]

@ -54,7 +54,7 @@ def collection_input(tmp_path_factory, collection_path_suffix):
skeleton = os.path.join(os.path.dirname(os.path.split(__file__)[0]), 'cli', 'test_data', 'collection_skeleton') skeleton = os.path.join(os.path.dirname(os.path.split(__file__)[0]), 'cli', 'test_data', 'collection_skeleton')
galaxy_args = ['ansible-galaxy', 'collection', 'init', '%s.%s' % (namespace, collection), galaxy_args = ['ansible-galaxy', 'collection', 'init', '%s.%s' % (namespace, collection),
'-c', '--init-path', test_dir, '--collection-skeleton', skeleton] '--init-path', test_dir, '--collection-skeleton', skeleton]
GalaxyCLI(args=galaxy_args).run() GalaxyCLI(args=galaxy_args).run()
collection_dir = os.path.join(test_dir, namespace, collection) collection_dir = os.path.join(test_dir, namespace, collection)
output_dir = to_text(tmp_path_factory.mktemp('test-ÅÑŚÌβŁÈ Collections Output')) output_dir = to_text(tmp_path_factory.mktemp('test-ÅÑŚÌβŁÈ Collections Output'))

@ -69,7 +69,7 @@ def collection_artifact(request, tmp_path_factory):
skeleton_path = os.path.join(os.path.dirname(os.path.split(__file__)[0]), 'cli', 'test_data', 'collection_skeleton') skeleton_path = os.path.join(os.path.dirname(os.path.split(__file__)[0]), 'cli', 'test_data', 'collection_skeleton')
collection_path = os.path.join(test_dir, namespace, collection) collection_path = os.path.join(test_dir, namespace, collection)
call_galaxy_cli(['init', '%s.%s' % (namespace, collection), '-c', '--init-path', test_dir, call_galaxy_cli(['init', '%s.%s' % (namespace, collection), '--init-path', test_dir,
'--collection-skeleton', skeleton_path]) '--collection-skeleton', skeleton_path])
dependencies = getattr(request, 'param', {}) dependencies = getattr(request, 'param', {})

@ -48,7 +48,7 @@ def init_role_dir(tmp_path_factory):
namespace = 'ansible_namespace' namespace = 'ansible_namespace'
role = 'role' role = 'role'
skeleton_path = os.path.join(os.path.dirname(os.path.split(__file__)[0]), 'cli', 'test_data', 'role_skeleton') skeleton_path = os.path.join(os.path.dirname(os.path.split(__file__)[0]), 'cli', 'test_data', 'role_skeleton')
call_galaxy_cli(['init', '%s.%s' % (namespace, role), '-c', '--init-path', test_dir, '--role-skeleton', skeleton_path]) call_galaxy_cli(['init', '%s.%s' % (namespace, role), '--init-path', test_dir, '--role-skeleton', skeleton_path])
def mock_NamedTemporaryFile(mocker, **args): def mock_NamedTemporaryFile(mocker, **args):

Loading…
Cancel
Save