# Path: tests/const.py
# DOCKER_IMAGE = 'debian:10'


import os
import sys
import subprocess
import tempfile
import shutil
from tests.const import DOCKER_IMAGE
#!/usr/bin/env python



class InTempDir:
    def __init__(self, suffix='', prefix='tmp', delete=True):
        self.delete = delete
        self.temp_path = tempfile.mkdtemp(suffix=suffix, prefix=prefix)

    def __enter__(self):
        self.orig_path = os.getcwd()
        os.chdir(self.temp_path)
        return self

    def __exit__(self, *exc_info):
        # Restore the working dir and cleanup the temp one
        os.chdir(self.orig_path)
        if self.delete:
            shutil.rmtree(self.temp_path)

def test1():
    with InTempDir(prefix='scuba-systest'):
        with open('.scuba.yml', 'w+t') as f:

# Path: tests/const.py
# DOCKER_IMAGE = 'debian:10'


# Path: run_full_tests.py
import os
import sys
import subprocess
import tempfile
import shutil
from tests.const import DOCKER_IMAGE

#!/usr/bin/env python



class InTempDir:
    def __init__(self, suffix='', prefix='tmp', delete=True):
        self.delete = delete
        self.temp_path = tempfile.mkdtemp(suffix=suffix, prefix=prefix)

    def __enter__(self):
        self.orig_path = os.getcwd()
        os.chdir(self.temp_path)
        return self

    def __exit__(self, *exc_info):
        # Restore the working dir and cleanup the temp one
        os.chdir(self.orig_path)
        if self.delete:
            shutil.rmtree(self.temp_path)

def test1():
    with InTempDir(prefix='scuba-systest'):
        with open('.scuba.yml', 'w+t') as f:

            f.write('image: {}\n'.format(DOCKER_IMAGE))