55import time
66import uuid
77from concurrent .futures import ThreadPoolExecutor
8- from pathlib import Path
98
109import mock
1110import paramiko
1918from juju .utils import block_until , run_with_interrupt , wait_for_bundle
2019
2120from .. import base
22-
23- MB = 1
24- GB = 1024
25- SSH_KEY = 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCsYMJGNGG74HAJha3n2CFmWYsOOaORnJK6VqNy86pj0MIpvRXBzFzVy09uPQ66GOQhTEoJHEqE77VMui7+62AcMXT+GG7cFHcnU8XVQsGM6UirCcNyWNysfiEMoAdZScJf/GvoY87tMEszhZIUV37z8PUBx6twIqMdr31W1J0IaPa+sV6FEDadeLaNTvancDcHK1zuKsL39jzAg7+LYjKJfEfrsQP+lj/EQcjtKqlhVS5kzsJVfx8ZEd0xhW5G7N6bCdKNalS8mKCMaBXJpijNQ82AiyqCIDCRrre2To0/i7pTjRiL0U9f9mV3S4NJaQaokR050w/ZLySFf6F7joJT mathijs@Qrama-Mathijs' # noqa
26- HERE_DIR = Path (__file__ ).absolute ().parent # tests/integration
27- TESTS_DIR = HERE_DIR .parent # tests/
28- OVERLAYS_DIR = HERE_DIR / 'bundle' / 'test-overlays'
21+ from ..utils import MB , GB , TESTS_DIR , OVERLAYS_DIR , SSH_KEY , INTEGRATION_TEST_DIR
2922
3023
3124@base .bootstrapped
@@ -68,7 +61,7 @@ async def test_deploy_local_bundle_file(event_loop):
6861@base .bootstrapped
6962@pytest .mark .asyncio
7063async def test_deploy_bundle_local_resource_relative_path (event_loop ):
71- bundle_file_path = HERE_DIR / 'bundle-file-resource.yaml'
64+ bundle_file_path = INTEGRATION_TEST_DIR / 'bundle-file-resource.yaml'
7265
7366 async with base .CleanModel () as model :
7467 await model .deploy (str (bundle_file_path ))
@@ -82,7 +75,7 @@ async def test_deploy_bundle_local_resource_relative_path(event_loop):
8275@base .bootstrapped
8376@pytest .mark .asyncio
8477async def test_deploy_local_bundle_include_file (event_loop ):
85- bundle_dir = TESTS_DIR / 'integration' / 'bundle'
78+ bundle_dir = INTEGRATION_TEST_DIR / 'bundle'
8679 bundle_yaml_path = bundle_dir / 'bundle-include-file.yaml'
8780
8881 async with base .CleanModel () as model :
@@ -99,7 +92,7 @@ async def test_deploy_local_bundle_include_file(event_loop):
9992@base .bootstrapped
10093@pytest .mark .asyncio
10194async def test_deploy_local_bundle_include_base64 (event_loop ):
102- bundle_dir = TESTS_DIR / 'integration' / 'bundle'
95+ bundle_dir = INTEGRATION_TEST_DIR / 'bundle'
10396 bundle_yaml_path = bundle_dir / 'bundle-include-base64.yaml'
10497
10598 async with base .CleanModel () as model :
@@ -115,7 +108,7 @@ async def test_deploy_local_bundle_include_base64(event_loop):
115108@base .bootstrapped
116109@pytest .mark .asyncio
117110async def test_deploy_bundle_local_charms (event_loop ):
118- bundle_path = TESTS_DIR / 'integration' / 'bundle' / 'local.yaml'
111+ bundle_path = INTEGRATION_TEST_DIR / 'bundle' / 'local.yaml'
119112
120113 async with base .CleanModel () as model :
121114 await model .deploy (bundle_path )
@@ -678,7 +671,7 @@ async def test_local_oci_image_resource_charm(event_loop):
678671@base .bootstrapped
679672@pytest .mark .asyncio
680673async def test_local_file_resource_charm (event_loop ):
681- charm_path = TESTS_DIR / 'integration' / 'file-resource-charm'
674+ charm_path = INTEGRATION_TEST_DIR / 'file-resource-charm'
682675 async with base .CleanModel () as model :
683676 resources = {"file-res" : "test.file" }
684677 app = await model .deploy (str (charm_path ), resources = resources )
@@ -716,7 +709,7 @@ async def test_attach_resource(event_loop):
716709async def test_store_resources_bundle (event_loop ):
717710 pytest .skip ('test_store_resources_bundle intermittent test failure' )
718711 async with base .CleanModel () as model :
719- bundle = str ( Path ( __file__ ). parent / 'bundle' )
712+ bundle = INTEGRATION_TEST_DIR / 'bundle'
720713 await model .deploy (bundle )
721714 assert 'ghost' in model .applications
722715 ghost = model .applications ['ghost' ]
@@ -738,7 +731,7 @@ async def test_store_resources_bundle(event_loop):
738731async def test_store_resources_bundle_revs (event_loop ):
739732 pytest .skip ('test_store_resources_bundle_revs intermittent test failure' )
740733 async with base .CleanModel () as model :
741- bundle = str ( Path ( __file__ ). parent / 'bundle/bundle-resource-rev.yaml' )
734+ bundle = INTEGRATION_TEST_DIR / 'bundle/bundle-resource-rev.yaml'
742735 await model .deploy (bundle )
743736 assert 'ghost' in model .applications
744737 ghost = model .applications ['ghost' ]
0 commit comments