From 320a5b77762c8b527e7ff98b7670c07c0ecee434 Mon Sep 17 00:00:00 2001 From: Wayne Witzel III Date: Fri, 29 Jan 2016 10:19:37 -0500 Subject: [PATCH] fixing tests that use inventory data --- awx/main/tests/functional/commands/commands_monolithic.py | 8 ++++---- awx/main/tests/functional/scripts.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/awx/main/tests/functional/commands/commands_monolithic.py b/awx/main/tests/functional/commands/commands_monolithic.py index 13dae57177..af4916e42d 100644 --- a/awx/main/tests/functional/commands/commands_monolithic.py +++ b/awx/main/tests/functional/commands/commands_monolithic.py @@ -1014,7 +1014,7 @@ class InventoryImportTest(BaseCommandMixin, BaseLiveServerTest): parts.query, parts.fragment]) os.environ.setdefault('REST_API_URL', rest_api_url) os.environ['INVENTORY_ID'] = str(old_inv.pk) - source = os.path.join(os.path.dirname(__file__), '..', '..', '..', 'plugins', + source = os.path.join(os.path.dirname(__file__), '..', '..', '..', '..', 'plugins', 'inventory', 'awxrest.py') result, stdout, stderr = self.run_command('inventory_import', inventory_id=new_inv.pk, @@ -1051,7 +1051,7 @@ class InventoryImportTest(BaseCommandMixin, BaseLiveServerTest): new_inv = self.organizations[0].inventories.create(name='newec2') self.assertEqual(new_inv.hosts.count(), 0) self.assertEqual(new_inv.groups.count(), 0) - os.chdir(os.path.join(os.path.dirname(__file__), '..', 'data')) + os.chdir(os.path.join(os.path.dirname(__file__), '..', '..', 'data')) inv_file = 'large_ec2_inventory.py' result, stdout, stderr = self.run_command('inventory_import', inventory_id=new_inv.pk, @@ -1072,7 +1072,7 @@ class InventoryImportTest(BaseCommandMixin, BaseLiveServerTest): new_inv = self.organizations[0].inventories.create(name='splunk') self.assertEqual(new_inv.hosts.count(), 0) self.assertEqual(new_inv.groups.count(), 0) - inv_file = os.path.join(os.path.dirname(__file__), '..', 'data', + inv_file = os.path.join(os.path.dirname(__file__), '..', '..', 'data', 'splunk_inventory.py') result, stdout, stderr = self.run_command('inventory_import', inventory_id=new_inv.pk, @@ -1095,7 +1095,7 @@ class InventoryImportTest(BaseCommandMixin, BaseLiveServerTest): def _check_largeinv_import(self, new_inv, nhosts, nhosts_inactive=0): self._start_time = time.time() - inv_file = os.path.join(os.path.dirname(__file__), '..', 'data', 'largeinv.py') + inv_file = os.path.join(os.path.dirname(__file__), '..', '..', 'data', 'largeinv.py') ngroups = self._get_ngroups_for_nhosts(nhosts) os.environ['NHOSTS'] = str(nhosts) result, stdout, stderr = self.run_command('inventory_import', diff --git a/awx/main/tests/functional/scripts.py b/awx/main/tests/functional/scripts.py index bdd81a7f7e..cdf6758921 100644 --- a/awx/main/tests/functional/scripts.py +++ b/awx/main/tests/functional/scripts.py @@ -130,7 +130,7 @@ class InventoryScriptTest(BaseScriptTest): os.environ.setdefault('REST_API_URL', rest_api_url) #os.environ.setdefault('REST_API_TOKEN', # self.super_django_user.auth_token.key) - name = os.path.join(os.path.dirname(__file__), '..', '..', 'plugins', + name = os.path.join(os.path.dirname(__file__), '..', '..', '..', 'plugins', 'inventory', 'awxrest.py') return self.run_script(name, *args, **options)