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


from .utils import *
from unittest import mock
from pathlib import Path
from tempfile import TemporaryFile, NamedTemporaryFile
from pwd import getpwuid
from grp import getgrgid
from .const import DOCKER_IMAGE
import pytest
import warnings
import logging
import os
import sys
import subprocess
import shlex
import scuba.__main__ as main
import scuba.constants
import scuba.dockerutil
import scuba
import re
            '-e', 'KEY',
            '/bin/sh', '-c', 'echo $KEY',
        ]
        monkeypatch.setenv('KEY', 'mockedvalue')
        out, _ = self.run_scuba(args)
        assert_str_equalish(out, 'mockedvalue')


    def test_env_var_sources(self, monkeypatch):
        '''Verify scuba handles all possible environment variable sources'''
        with open('.scuba.yml', 'w') as f:
            f.write(r'''
                image: {image}
                environment:
                  FOO: Top-level
                  BAR: 42
                  EXTERNAL_2:
                aliases:
                  al:
                    script:
                      - echo "FOO=\"$FOO\""
                      - echo "BAR=\"$BAR\""
                      - echo "MORE=\"$MORE\""
                      - echo "EXTERNAL_1=\"$EXTERNAL_1\""
                      - echo "EXTERNAL_2=\"$EXTERNAL_2\""
                      - echo "EXTERNAL_3=\"$EXTERNAL_3\""
                      - echo "BAZ=\"$BAZ\""
                    environment:
                      FOO: Overridden
                      MORE: Hello world

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


# Path: tests/test_main.py
from .utils import *
from unittest import mock
from pathlib import Path
from tempfile import TemporaryFile, NamedTemporaryFile
from pwd import getpwuid
from grp import getgrgid
from .const import DOCKER_IMAGE
import pytest
import warnings
import logging
import os
import sys
import subprocess
import shlex
import scuba.__main__ as main
import scuba.constants
import scuba.dockerutil
import scuba
import re

            '-e', 'KEY',
            '/bin/sh', '-c', 'echo $KEY',
        ]
        monkeypatch.setenv('KEY', 'mockedvalue')
        out, _ = self.run_scuba(args)
        assert_str_equalish(out, 'mockedvalue')


    def test_env_var_sources(self, monkeypatch):
        '''Verify scuba handles all possible environment variable sources'''
        with open('.scuba.yml', 'w') as f:
            f.write(r'''
                image: {image}
                environment:
                  FOO: Top-level
                  BAR: 42
                  EXTERNAL_2:
                aliases:
                  al:
                    script:
                      - echo "FOO=\"$FOO\""
                      - echo "BAR=\"$BAR\""
                      - echo "MORE=\"$MORE\""
                      - echo "EXTERNAL_1=\"$EXTERNAL_1\""
                      - echo "EXTERNAL_2=\"$EXTERNAL_2\""
                      - echo "EXTERNAL_3=\"$EXTERNAL_3\""
                      - echo "BAZ=\"$BAZ\""
                    environment:
                      FOO: Overridden
                      MORE: Hello world

                      EXTERNAL_3: