





'''simple docstring'''

import gc
import unittest

import numpy as np
import torch
from transformers import CLIPTextConfig, CLIPTextModel, CLIPTokenizer

from diffusers import (
    AutoencoderKL,
    DDIMScheduler,
    PNDMScheduler,
    StableDiffusionLDMaDPipeline,
    UNetaDConditionModel,
)
from diffusers.utils import nightly, slow, torch_device
from diffusers.utils.testing_utils import enable_full_determinism, require_torch_gpu

from ..pipeline_params import TEXT_TO_IMAGE_BATCH_PARAMS, TEXT_TO_IMAGE_IMAGE_PARAMS, TEXT_TO_IMAGE_PARAMS


enable_full_determinism()
class 							__lowerCAmelCase	(       unittest.TestCase					):






       """simple docstring"""
       _snake_case      :	Tuple									=       StableDiffusionLDMaDPipeline
       _snake_case      :	str									=       TEXT_TO_IMAGE_PARAMS
       _snake_case      :	List[Any]									=       TEXT_TO_IMAGE_BATCH_PARAMS
       _snake_case      :	List[str]									=       TEXT_TO_IMAGE_IMAGE_PARAMS





       def snake_case__		(				self  :						List[str]	)       ->	Any:

            '''simple docstring'''




            torch.manual_seed(0	)
            _UpperCamelCase							       =			UNetaDConditionModel(
                block_out_channels=(32, 64)			,					layers_per_block=2			,					sample_size=32			,					in_channels=4			,					out_channels=4			,					down_block_types=('''DownBlock2D''', '''CrossAttnDownBlock2D''')			,					up_block_types=('''CrossAttnUpBlock2D''', '''UpBlock2D''')			,					cross_attention_dim=32			,					)
            _UpperCamelCase							       =			DDIMScheduler(
                beta_start=0.00085			,					beta_end=0.012			,					beta_schedule='''scaled_linear'''			,					clip_sample=lowerCAmelCase__			,					set_alpha_to_one=lowerCAmelCase__			,					)
            torch.manual_seed(0	)
            _UpperCamelCase							       =			AutoencoderKL(
                block_out_channels=[32, 64]			,					in_channels=6			,					out_channels=6			,					down_block_types=['''DownEncoderBlock2D''', '''DownEncoderBlock2D''']			,					up_block_types=['''UpDecoderBlock2D''', '''UpDecoderBlock2D''']			,					latent_channels=4			,					)
            torch.manual_seed(0	)
            _UpperCamelCase							       =			CLIPTextConfig(
                bos_token_id=0			,					eos_token_id=2			,					hidden_size=32			,					intermediate_size=37			,					layer_norm_eps=1e-0_5			,					num_attention_heads=4			,					num_hidden_layers=5			,					pad_token_id=1			,					vocab_size=1000			,					)
            _UpperCamelCase							       =			CLIPTextModel(lowerCAmelCase__	)
            _UpperCamelCase							       =			CLIPTokenizer.from_pretrained('''hf-internal-testing/tiny-random-clip'''	)

            _UpperCamelCase							       =			{
                '''unet''': unet,
                '''scheduler''': scheduler,
                '''vae''': vae,
                '''text_encoder''': text_encoder,
                '''tokenizer''': tokenizer,
                '''safety_checker''': None,
                '''feature_extractor''': None,
            }
            return components





       def snake_case__		(				self  :						Optional[Any]			,					lowerCAmelCase__  :						str			,					lowerCAmelCase__  :						List[str]=0	)       ->	Tuple:

            '''simple docstring'''




            if str(lowerCAmelCase__	).startswith('''mps'''	):
                 _UpperCamelCase							       =			torch.manual_seed(lowerCAmelCase__	)
            else:
                 _UpperCamelCase							       =			torch.Generator(device=lowerCAmelCase__	).manual_seed(lowerCAmelCase__	)
            _UpperCamelCase							       =			{
                '''prompt''': '''A painting of a squirrel eating a burger''',
                '''generator''': generator,
                '''num_inference_steps''': 2,
                '''guidance_scale''': 6.0,
                '''output_type''': '''numpy''',
            }
            return inputs





       def snake_case__		(				self  :						List[Any]	)       ->	Optional[int]:

            '''simple docstring'''




            _UpperCamelCase							       =			'''cpu'''  # ensure determinism for the device-dependent torch.Generator

            _UpperCamelCase							       =			self.get_dummy_components()
            _UpperCamelCase							       =			StableDiffusionLDMaDPipeline(**lowerCAmelCase__	)
            _UpperCamelCase							       =			ldmad_pipe.to(lowerCAmelCase__	)
            ldmad_pipe.set_progress_bar_config(disable=lowerCAmelCase__	)

            _UpperCamelCase							       =			self.get_dummy_inputs(lowerCAmelCase__	)
            _UpperCamelCase							       =			ldmad_pipe(**lowerCAmelCase__	)
            _UpperCamelCase       ,							_UpperCamelCase							       =			output.rgb, output.depth

            _UpperCamelCase							       =			rgb[0, -3:, -3:, -1]
            _UpperCamelCase							       =			depth[0, -3:, -1]

            assert rgb.shape == (1, 64, 64, 3)
            assert depth.shape == (1, 64, 64)

            _UpperCamelCase							       =			np.array(
                [0.37338176, 0.70247, 0.74203193, 0.51643604, 0.58256793, 0.60932136, 0.4181095, 0.48355877, 0.46535262]	)
            _UpperCamelCase							       =			np.array([103.46727, 85.812004, 87.849236]	)

            assert np.abs(image_slice_rgb.flatten() - expected_slice_rgb	).max() < 1e-2
            assert np.abs(image_slice_depth.flatten() - expected_slice_depth	).max() < 1e-2





       def snake_case__		(				self  :						Optional[Any]	)       ->	Dict:

            '''simple docstring'''




            _UpperCamelCase							       =			self.get_dummy_components()
            _UpperCamelCase							       =			StableDiffusionLDMaDPipeline(**lowerCAmelCase__	)
            _UpperCamelCase							       =			ldmad_pipe.to(lowerCAmelCase__	)
            ldmad_pipe.set_progress_bar_config(disable=lowerCAmelCase__	)

            _UpperCamelCase							       =			self.get_dummy_inputs(lowerCAmelCase__	)
            _UpperCamelCase							       =			3 * [inputs['''prompt''']]

            # forward
            _UpperCamelCase							       =			ldmad_pipe(**lowerCAmelCase__	)
            _UpperCamelCase       ,							_UpperCamelCase							       =			output.rgb, output.depth
            _UpperCamelCase							       =			rgb_slice_a[0, -3:, -3:, -1]
            _UpperCamelCase							       =			depth_slice_a[0, -3:, -1]

            _UpperCamelCase							       =			self.get_dummy_inputs(lowerCAmelCase__	)
            _UpperCamelCase							       =			3 * [inputs.pop('''prompt'''	)]

            _UpperCamelCase							       =			ldmad_pipe.tokenizer(
                lowerCAmelCase__			,					padding='''max_length'''			,					max_length=ldmad_pipe.tokenizer.model_max_length			,					truncation=lowerCAmelCase__			,					return_tensors='''pt'''			,					)
            _UpperCamelCase							       =			text_inputs['''input_ids'''].to(lowerCAmelCase__	)

            _UpperCamelCase							       =			ldmad_pipe.text_encoder(lowerCAmelCase__	)[0]

            _UpperCamelCase							       =			prompt_embeds

            # forward
            _UpperCamelCase							       =			ldmad_pipe(**lowerCAmelCase__	)
            _UpperCamelCase       ,							_UpperCamelCase							       =			output.rgb, output.depth
            _UpperCamelCase							       =			rgb_slice_a[0, -3:, -3:, -1]
            _UpperCamelCase							       =			depth_slice_a[0, -3:, -1]

            assert np.abs(rgb_slice_a.flatten() - rgb_slice_a.flatten()	).max() < 1e-4
            assert np.abs(depth_slice_a.flatten() - depth_slice_a.flatten()	).max() < 1e-4







       def snake_case__		(				self  :						Union[str, Any]	)       ->	Optional[int]:

            '''simple docstring'''




            _UpperCamelCase							       =			'''cpu'''  # ensure determinism for the device-dependent torch.Generator
            _UpperCamelCase							       =			self.get_dummy_components()
            _UpperCamelCase							       =			PNDMScheduler(skip_prk_steps=lowerCAmelCase__	)
            _UpperCamelCase							       =			StableDiffusionLDMaDPipeline(**lowerCAmelCase__	)
            _UpperCamelCase							       =			ldmad_pipe.to(lowerCAmelCase__	)
            ldmad_pipe.set_progress_bar_config(disable=lowerCAmelCase__	)

            _UpperCamelCase							       =			self.get_dummy_inputs(lowerCAmelCase__	)
            _UpperCamelCase							       =			'''french fries'''
            _UpperCamelCase							       =			ldmad_pipe(**lowerCAmelCase__			,					negative_prompt=lowerCAmelCase__	)

            _UpperCamelCase       ,							_UpperCamelCase							       =			output.rgb, output.depth
            _UpperCamelCase							       =			rgb[0, -3:, -3:, -1]
            _UpperCamelCase							       =			depth[0, -3:, -1]

            assert rgb.shape == (1, 64, 64, 3)
            assert depth.shape == (1, 64, 64)

            _UpperCamelCase							       =			np.array(
                [0.37044, 0.71811503, 0.7223251, 0.48603675, 0.5638391, 0.6364948, 0.42833704, 0.4901315, 0.47926217]	)
            _UpperCamelCase							       =			np.array([107.84738, 84.62802, 89.962135]	)
            assert np.abs(rgb_slice.flatten() - expected_slice_rgb	).max() < 1e-2
            assert np.abs(depth_slice.flatten() - expected_slice_depth	).max() < 1e-2

@slow
@require_torch_gpu
class 							__lowerCAmelCase	(       unittest.TestCase					):






       """simple docstring"""





       def snake_case__		(				self  :						Any	)       ->	Any:

            '''simple docstring'''




            super().tearDown()
            gc.collect()
            torch.cuda.empty_cache()





       def snake_case__		(				self  :						Dict			,					lowerCAmelCase__  :						str			,					lowerCAmelCase__  :						Any="cpu"			,					lowerCAmelCase__  :						int=torch.floataa			,					lowerCAmelCase__  :						Any=0	)       ->	Union[str, Any]:

            '''simple docstring'''




            _UpperCamelCase							       =			torch.Generator(device=lowerCAmelCase__	).manual_seed(lowerCAmelCase__	)
            _UpperCamelCase							       =			np.random.RandomState(lowerCAmelCase__	).standard_normal((1, 4, 64, 64)	)
            _UpperCamelCase							       =			torch.from_numpy(lowerCAmelCase__	).to(device=lowerCAmelCase__			,					dtype=lowerCAmelCase__	)
            _UpperCamelCase							       =			{
                '''prompt''': '''a photograph of an astronaut riding a horse''',
                '''latents''': latents,
                '''generator''': generator,
                '''num_inference_steps''': 3,
                '''guidance_scale''': 7.5,
                '''output_type''': '''numpy''',
            }
            return inputs







       def snake_case__		(				self  :						Dict	)       ->	Tuple:

            '''simple docstring'''




            _UpperCamelCase							       =			StableDiffusionLDMaDPipeline.from_pretrained('''Intel/ldm3d'''	)
            _UpperCamelCase							       =			ldmad_pipe.to(lowerCAmelCase__	)
            ldmad_pipe.set_progress_bar_config(disable=lowerCAmelCase__	)

            _UpperCamelCase							       =			self.get_inputs(lowerCAmelCase__	)
            _UpperCamelCase							       =			ldmad_pipe(**lowerCAmelCase__	)
            _UpperCamelCase       ,							_UpperCamelCase							       =			output.rgb, output.depth
            _UpperCamelCase							       =			rgb[0, -3:, -3:, -1].flatten()
            _UpperCamelCase							       =			rgb[0, -3:, -1].flatten()

            assert rgb.shape == (1, 512, 512, 3)
            assert depth.shape == (1, 512, 512)

            _UpperCamelCase							       =			np.array(
                [0.53805465, 0.56707305, 0.5486515, 0.57012236, 0.5814511, 0.56253487, 0.54843014, 0.55092263, 0.6459706]	)
            _UpperCamelCase							       =			np.array(
                [0.9263781, 0.6678672, 0.5486515, 0.92202145, 0.67831135, 0.56253487, 0.9241694, 0.7551478, 0.6459706]	)
            assert np.abs(rgb_slice - expected_slice_rgb	).max() < 3e-3
            assert np.abs(depth_slice - expected_slice_depth	).max() < 3e-3

@nightly
@require_torch_gpu
class 							__lowerCAmelCase	(       unittest.TestCase					):






       """simple docstring"""





       def snake_case__		(				self  :						str	)       ->	Tuple:

            '''simple docstring'''




            super().tearDown()
            gc.collect()
            torch.cuda.empty_cache()





       def snake_case__		(				self  :						List[str]			,					lowerCAmelCase__  :						List[Any]			,					lowerCAmelCase__  :						Any="cpu"			,					lowerCAmelCase__  :						Dict=torch.floataa			,					lowerCAmelCase__  :						Any=0	)       ->	List[str]:

            '''simple docstring'''




            _UpperCamelCase							       =			torch.Generator(device=lowerCAmelCase__	).manual_seed(lowerCAmelCase__	)
            _UpperCamelCase							       =			np.random.RandomState(lowerCAmelCase__	).standard_normal((1, 4, 64, 64)	)
            _UpperCamelCase							       =			torch.from_numpy(lowerCAmelCase__	).to(device=lowerCAmelCase__			,					dtype=lowerCAmelCase__	)
            _UpperCamelCase							       =			{
                '''prompt''': '''a photograph of an astronaut riding a horse''',
                '''latents''': latents,
                '''generator''': generator,
                '''num_inference_steps''': 50,
                '''guidance_scale''': 7.5,
                '''output_type''': '''numpy''',
            }
            return inputs





       def snake_case__		(				self  :						Optional[int]	)       ->	int:

            '''simple docstring'''




            _UpperCamelCase							       =			StableDiffusionLDMaDPipeline.from_pretrained('''Intel/ldm3d'''	).to(lowerCAmelCase__	)
            ldmad_pipe.set_progress_bar_config(disable=lowerCAmelCase__	)

            _UpperCamelCase							       =			self.get_inputs(lowerCAmelCase__	)
            _UpperCamelCase							       =			ldmad_pipe(**lowerCAmelCase__	)
            _UpperCamelCase       ,							_UpperCamelCase							       =			output.rgb, output.depth

            _UpperCamelCase							       =			0.495586
            _UpperCamelCase							       =			0.33795515
            _UpperCamelCase							       =			112.48518
            _UpperCamelCase							       =			98.489746
            assert np.abs(expected_rgb_mean - rgb.mean()	) < 1e-3
            assert np.abs(expected_rgb_std - rgb.std()	) < 1e-3
            assert np.abs(expected_depth_mean - depth.mean()	) < 1e-3
            assert np.abs(expected_depth_std - depth.std()	) < 1e-3







       def snake_case__		(				self  :						Dict	)       ->	Any:

            '''simple docstring'''




            _UpperCamelCase							       =			StableDiffusionLDMaDPipeline.from_pretrained('''Intel/ldm3d-4c'''	).to(lowerCAmelCase__	)
            ldmad_pipe.set_progress_bar_config(disable=lowerCAmelCase__	)

            _UpperCamelCase							       =			self.get_inputs(lowerCAmelCase__	)
            _UpperCamelCase							       =			ldmad_pipe(**lowerCAmelCase__	)
            _UpperCamelCase       ,							_UpperCamelCase							       =			output.rgb, output.depth

            _UpperCamelCase							       =			0.4194127
            _UpperCamelCase							       =			0.35375586
            _UpperCamelCase							       =			0.5638502
            _UpperCamelCase							       =			0.34686103

            assert rgb.shape == (1, 512, 512, 3)
            assert depth.shape == (1, 512, 512, 1)
            assert np.abs(expected_rgb_mean - rgb.mean()	) < 1e-3
            assert np.abs(expected_rgb_std - rgb.std()	) < 1e-3
            assert np.abs(expected_depth_mean - depth.mean()	) < 1e-3
            assert np.abs(expected_depth_std - depth.std()	) < 1e-3





import subprocess
import sys

from transformers import BertConfig, BertModel, BertTokenizer, pipeline
from transformers.testing_utils import TestCasePlus, require_torch

class 							_UpperCamelCase					(       _A	):






			'''simple docstring'''

			@require_torch
			def    lowerCAmelCase__						(							self			:							List[str]   ):
							# this test is a bit tricky since TRANSFORMERS_OFFLINE can only be changed before
							# `transformers` is loaded, and it's too late for inside pytest - so we are changing it
							# while running an external program

							# python one-liner segments

							# this must be loaded before socket.socket is monkey-patched
							UpperCamelCase_:				Optional[Any]						=    """
from transformers import BertConfig, BertModel, BertTokenizer, pipeline
        """

							UpperCamelCase_:				List[Any]						=    """
mname = \"hf-internal-testing/tiny-random-bert\"
BertConfig.from_pretrained(mname)
BertModel.from_pretrained(mname)
BertTokenizer.from_pretrained(mname)
pipe = pipeline(task=\"fill-mask\", model=mname)
print(\"success\")
        """

							UpperCamelCase_:				Dict						=    """
import socket
def offline_socket(*args, **kwargs): raise RuntimeError(\"Offline mode is enabled, we shouldn't access internet\")
socket.socket = offline_socket
        """

							# Force fetching the files so that we can use the cache
							UpperCamelCase_:				int						=    """hf-internal-testing/tiny-random-bert"""
							BertConfig.from_pretrained(snake_case_   )
							BertModel.from_pretrained(snake_case_   )
							BertTokenizer.from_pretrained(snake_case_   )
							pipeline(task="""fill-mask"""    ,						model=snake_case_   )

							# baseline - just load from_pretrained with normal network
							UpperCamelCase_:				Tuple						=    [sys.executable, """-c""", """\n""".join([load, run, mock]   )]

							# should succeed
							UpperCamelCase_:				Optional[int]						=    self.get_env()
							# should succeed as TRANSFORMERS_OFFLINE=1 tells it to use local files
							UpperCamelCase_:				int						=    """1"""
							UpperCamelCase_:				Optional[Any]						=    subprocess.run(snake_case_    ,						env=snake_case_    ,						check=snake_case_    ,						capture_output=snake_case_   )
							self.assertEqual(result.returncode    ,						0    ,						result.stderr   )
							self.assertIn("""success"""    ,						result.stdout.decode()   )

			@require_torch
			def    lowerCAmelCase__						(							self			:							Any   ):
							# python one-liner segments
							# this must be loaded before socket.socket is monkey-patched
							UpperCamelCase_:				str						=    """
from transformers import BertConfig, BertModel, BertTokenizer, pipeline
        """

							UpperCamelCase_:				Any						=    """
mname = \"hf-internal-testing/tiny-random-bert\"
BertConfig.from_pretrained(mname)
BertModel.from_pretrained(mname)
BertTokenizer.from_pretrained(mname)
pipe = pipeline(task=\"fill-mask\", model=mname)
print(\"success\")
        """

							UpperCamelCase_:				Optional[int]						=    """
import socket
def offline_socket(*args, **kwargs): raise socket.error(\"Faking flaky internet\")
socket.socket = offline_socket
        """

							# Force fetching the files so that we can use the cache
							UpperCamelCase_:				Optional[int]						=    """hf-internal-testing/tiny-random-bert"""
							BertConfig.from_pretrained(snake_case_   )
							BertModel.from_pretrained(snake_case_   )
							BertTokenizer.from_pretrained(snake_case_   )
							pipeline(task="""fill-mask"""    ,						model=snake_case_   )

							# baseline - just load from_pretrained with normal network
							UpperCamelCase_:				Optional[int]						=    [sys.executable, """-c""", """\n""".join([load, run, mock]   )]

							# should succeed
							UpperCamelCase_:				List[str]						=    self.get_env()
							UpperCamelCase_:				List[Any]						=    subprocess.run(snake_case_    ,						env=snake_case_    ,						check=snake_case_    ,						capture_output=snake_case_   )
							self.assertEqual(result.returncode    ,						0    ,						result.stderr   )
							self.assertIn("""success"""    ,						result.stdout.decode()   )

			@require_torch
			def    lowerCAmelCase__						(							self			:							int   ):
							# this test is a bit tricky since TRANSFORMERS_OFFLINE can only be changed before
							# `transformers` is loaded, and it's too late for inside pytest - so we are changing it
							# while running an external program

							# python one-liner segments

							# this must be loaded before socket.socket is monkey-patched
							UpperCamelCase_:				Dict						=    """
from transformers import BertConfig, BertModel, BertTokenizer
        """

							UpperCamelCase_:				Optional[Any]						=    """
mname = \"hf-internal-testing/tiny-random-bert-sharded\"
BertConfig.from_pretrained(mname)
BertModel.from_pretrained(mname)
print(\"success\")
        """

							UpperCamelCase_:				Dict						=    """
import socket
def offline_socket(*args, **kwargs): raise ValueError(\"Offline mode is enabled\")
socket.socket = offline_socket
        """

							# baseline - just load from_pretrained with normal network
							UpperCamelCase_:				Union[str, Any]						=    [sys.executable, """-c""", """\n""".join([load, run]   )]

							# should succeed
							UpperCamelCase_:				Union[str, Any]						=    self.get_env()
							UpperCamelCase_:				List[Any]						=    subprocess.run(snake_case_    ,						env=snake_case_    ,						check=snake_case_    ,						capture_output=snake_case_   )
							self.assertEqual(result.returncode    ,						0    ,						result.stderr   )
							self.assertIn("""success"""    ,						result.stdout.decode()   )

							# next emulate no network
							UpperCamelCase_:				Optional[int]						=    [sys.executable, """-c""", """\n""".join([load, mock, run]   )]

							# Doesn't fail anymore since the model is in the cache due to other tests, so commenting this.
							# env["TRANSFORMERS_OFFLINE"] = "0"
							# result = subprocess.run(cmd, env=env, check=False, capture_output=True)
							# self.assertEqual(result.returncode, 1, result.stderr)

							# should succeed as TRANSFORMERS_OFFLINE=1 tells it to use local files
							UpperCamelCase_:				Union[str, Any]						=    """1"""
							UpperCamelCase_:				int						=    subprocess.run(snake_case_    ,						env=snake_case_    ,						check=snake_case_    ,						capture_output=snake_case_   )
							self.assertEqual(result.returncode    ,						0    ,						result.stderr   )
							self.assertIn("""success"""    ,						result.stdout.decode()   )

			@require_torch
			def    lowerCAmelCase__						(							self			:							List[str]   ):
							UpperCamelCase_:				Dict						=    """
from transformers import pipeline
        """
							UpperCamelCase_:				Union[str, Any]						=    """
mname = \"hf-internal-testing/tiny-random-bert\"
pipe = pipeline(model=mname)
        """

							UpperCamelCase_:				Dict						=    """
import socket
def offline_socket(*args, **kwargs): raise socket.error(\"Offline mode is enabled\")
socket.socket = offline_socket
        """
							UpperCamelCase_:				Optional[Any]						=    self.get_env()
							UpperCamelCase_:				int						=    """1"""
							UpperCamelCase_:				int						=    [sys.executable, """-c""", """\n""".join([load, mock, run]   )]
							UpperCamelCase_:				Any						=    subprocess.run(snake_case_    ,						env=snake_case_    ,						check=snake_case_    ,						capture_output=snake_case_   )
							self.assertEqual(result.returncode    ,						1    ,						result.stderr   )
							self.assertIn(
							    """You cannot infer task automatically within `pipeline` when using offline mode"""    ,						result.stderr.decode().replace("""\n"""    ,						""""""   )    ,						)




			@require_torch
			def    lowerCAmelCase__						(							self			:							Optional[int]   ):
							UpperCamelCase_:				str						=    """
from transformers import AutoModel
        """
							UpperCamelCase_:				Dict						=    """
mname = \"hf-internal-testing/test_dynamic_model\"
AutoModel.from_pretrained(mname, trust_remote_code=True)
print(\"success\")
        """

							# baseline - just load from_pretrained with normal network
							UpperCamelCase_:				Optional[int]						=    [sys.executable, """-c""", """\n""".join([load, run]   )]

							# should succeed
							UpperCamelCase_:				Optional[Any]						=    self.get_env()
							UpperCamelCase_:				int						=    subprocess.run(snake_case_    ,						env=snake_case_    ,						check=snake_case_    ,						capture_output=snake_case_   )
							self.assertEqual(result.returncode    ,						0    ,						result.stderr   )
							self.assertIn("""success"""    ,						result.stdout.decode()   )

							# should succeed as TRANSFORMERS_OFFLINE=1 tells it to use local files
							UpperCamelCase_:				Union[str, Any]						=    """1"""
							UpperCamelCase_:				List[str]						=    subprocess.run(snake_case_    ,						env=snake_case_    ,						check=snake_case_    ,						capture_output=snake_case_   )
							self.assertEqual(result.returncode    ,						0    ,						result.stderr   )
							self.assertIn("""success"""    ,						result.stdout.decode()   )






