mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Update galaxy and database unit tests. (#21209)
* Update galaxy unit tests to work from tmp dir. * Fix sorting of database tests.
This commit is contained in:
parent
4189592701
commit
2b9a0fb952
2 changed files with 8 additions and 2 deletions
|
@ -39,6 +39,10 @@ class TestGalaxy(unittest.TestCase):
|
||||||
'''creating prerequisites for installing a role; setUpClass occurs ONCE whereas setUp occurs with every method tested.'''
|
'''creating prerequisites for installing a role; setUpClass occurs ONCE whereas setUp occurs with every method tested.'''
|
||||||
# class data for easy viewing: role_dir, role_tar, role_name, role_req, role_path
|
# class data for easy viewing: role_dir, role_tar, role_name, role_req, role_path
|
||||||
|
|
||||||
|
cls.temp_dir = tempfile.mkdtemp('galaxy')
|
||||||
|
|
||||||
|
os.chdir(cls.temp_dir)
|
||||||
|
|
||||||
if os.path.exists("./delete_me"):
|
if os.path.exists("./delete_me"):
|
||||||
shutil.rmtree("./delete_me")
|
shutil.rmtree("./delete_me")
|
||||||
|
|
||||||
|
@ -88,6 +92,8 @@ class TestGalaxy(unittest.TestCase):
|
||||||
os.remove(cls.role_tar)
|
os.remove(cls.role_tar)
|
||||||
if os.path.isdir(cls.role_path):
|
if os.path.isdir(cls.role_path):
|
||||||
shutil.rmtree(cls.role_path)
|
shutil.rmtree(cls.role_path)
|
||||||
|
if os.path.isdir(cls.temp_dir):
|
||||||
|
shutil.rmtree(cls.temp_dir)
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.default_args = []
|
self.default_args = []
|
||||||
|
|
|
@ -73,8 +73,8 @@ HOW_MANY_DOTS = (
|
||||||
'PostgreSQL does not support column with more than 4 dots'),
|
'PostgreSQL does not support column with more than 4 dots'),
|
||||||
)
|
)
|
||||||
|
|
||||||
VALID_QUOTES = ((test, VALID[test]) for test in VALID)
|
VALID_QUOTES = sorted((test, VALID[test]) for test in VALID)
|
||||||
INVALID_QUOTES = ((test[0], test[1], INVALID[test]) for test in INVALID)
|
INVALID_QUOTES = sorted((test[0], test[1], INVALID[test]) for test in INVALID)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("identifier, quoted_identifier", VALID_QUOTES)
|
@pytest.mark.parametrize("identifier, quoted_identifier", VALID_QUOTES)
|
||||||
|
|
Loading…
Reference in a new issue