






import unittest

from diffusers.pipelines.pipeline_utils import is_safetensors_compatible



class 							SCREAMING_SNAKE_CASE__		(       unittest.TestCase		):





					"""simple docstring"""






					def  _lowercase  (      self  :						Union[str, Any] ):
						snake_case__				:   Tuple     =						[
						    "safety_checker/pytorch_model.bin",
						    "safety_checker/model.safetensors",
						    "vae/diffusion_pytorch_model.bin",
						    "vae/diffusion_pytorch_model.safetensors",
						    "text_encoder/pytorch_model.bin",
						    "text_encoder/model.safetensors",
						    "unet/diffusion_pytorch_model.bin",
						    "unet/diffusion_pytorch_model.safetensors",
						]
						self.assertTrue(is_safetensors_compatible(__A ) )



					def  _lowercase  (      self  :						Optional[Any] ):
						snake_case__				:   Union[str, Any]     =						[
						    "unet/diffusion_pytorch_model.bin",
						    "unet/diffusion_pytorch_model.safetensors",
						]
						self.assertTrue(is_safetensors_compatible(__A ) )



					def  _lowercase  (      self  :						Any ):
						snake_case__				:   Tuple     =						[
						    "safety_checker/pytorch_model.bin",
						    "safety_checker/model.safetensors",
						    "vae/diffusion_pytorch_model.bin",
						    "vae/diffusion_pytorch_model.safetensors",
						    "text_encoder/pytorch_model.bin",
						    "text_encoder/model.safetensors",
						    "unet/diffusion_pytorch_model.bin",
						    # Removed: 'unet/diffusion_pytorch_model.safetensors',
						]
						self.assertFalse(is_safetensors_compatible(__A ) )



					def  _lowercase  (      self  :						int ):
						snake_case__				:   int     =						[
						    "text_encoder/pytorch_model.bin",
						    "text_encoder/model.safetensors",
						]
						self.assertTrue(is_safetensors_compatible(__A ) )



					def  _lowercase  (      self  :						Optional[Any] ):
						snake_case__				:   str     =						[
						    "safety_checker/pytorch_model.bin",
						    "safety_checker/model.safetensors",
						    "vae/diffusion_pytorch_model.bin",
						    "vae/diffusion_pytorch_model.safetensors",
						    "text_encoder/pytorch_model.bin",
						    # Removed: 'text_encoder/model.safetensors',
						    "unet/diffusion_pytorch_model.bin",
						    "unet/diffusion_pytorch_model.safetensors",
						]
						self.assertFalse(is_safetensors_compatible(__A ) )



					def  _lowercase  (      self  :						str ):
						snake_case__				:   Dict     =						[
						    "safety_checker/pytorch_model.fp16.bin",
						    "safety_checker/model.fp16.safetensors",
						    "vae/diffusion_pytorch_model.fp16.bin",
						    "vae/diffusion_pytorch_model.fp16.safetensors",
						    "text_encoder/pytorch_model.fp16.bin",
						    "text_encoder/model.fp16.safetensors",
						    "unet/diffusion_pytorch_model.fp16.bin",
						    "unet/diffusion_pytorch_model.fp16.safetensors",
						]
						snake_case__				:   str     =						"fp16"
						self.assertTrue(is_safetensors_compatible(__A							,	variant=__A ) )



					def  _lowercase  (      self  :						str ):
						snake_case__				:   Tuple     =						[
						    "unet/diffusion_pytorch_model.fp16.bin",
						    "unet/diffusion_pytorch_model.fp16.safetensors",
						]
						snake_case__				:   Dict     =						"fp16"
						self.assertTrue(is_safetensors_compatible(__A							,	variant=__A ) )



					def  _lowercase  (      self  :						Optional[Any] ):
						# pass variant but use the non-variant filenames
						snake_case__				:   str     =						[
						    "unet/diffusion_pytorch_model.bin",
						    "unet/diffusion_pytorch_model.safetensors",
						]
						snake_case__				:   Any     =						"fp16"
						self.assertTrue(is_safetensors_compatible(__A							,	variant=__A ) )



					def  _lowercase  (      self  :						List[str] ):
						snake_case__				:   Tuple     =						[
						    "safety_checker/pytorch_model.fp16.bin",
						    "safety_checker/model.fp16.safetensors",
						    "vae/diffusion_pytorch_model.fp16.bin",
						    "vae/diffusion_pytorch_model.fp16.safetensors",
						    "text_encoder/pytorch_model.fp16.bin",
						    "text_encoder/model.fp16.safetensors",
						    "unet/diffusion_pytorch_model.fp16.bin",
						    # Removed: 'unet/diffusion_pytorch_model.fp16.safetensors',
						]
						snake_case__				:   Dict     =						"fp16"
						self.assertFalse(is_safetensors_compatible(__A							,	variant=__A ) )



					def  _lowercase  (      self  :						List[Any] ):
						snake_case__				:   Any     =						[
						    "text_encoder/pytorch_model.fp16.bin",
						    "text_encoder/model.fp16.safetensors",
						]
						snake_case__				:   Union[str, Any]     =						"fp16"
						self.assertTrue(is_safetensors_compatible(__A							,	variant=__A ) )



					def  _lowercase  (      self  :						Optional[int] ):
						# pass variant but use the non-variant filenames
						snake_case__				:   List[str]     =						[
						    "text_encoder/pytorch_model.bin",
						    "text_encoder/model.safetensors",
						]
						snake_case__				:   List[Any]     =						"fp16"
						self.assertTrue(is_safetensors_compatible(__A							,	variant=__A ) )






					def  _lowercase  (      self  :						Any ):
						snake_case__				:   Optional[int]     =						[
						    "safety_checker/pytorch_model.fp16.bin",
						    "safety_checker/model.fp16.safetensors",
						    "vae/diffusion_pytorch_model.fp16.bin",
						    "vae/diffusion_pytorch_model.fp16.safetensors",
						    "text_encoder/pytorch_model.fp16.bin",
						    # 'text_encoder/model.fp16.safetensors',
						    "unet/diffusion_pytorch_model.fp16.bin",
						    "unet/diffusion_pytorch_model.fp16.safetensors",
						]
						snake_case__				:   List[Any]     =						"fp16"
						self.assertFalse(is_safetensors_compatible(__A							,	variant=__A ) )











# tests directory-specific settings - this file is run automatically
# by pytest before any tests are run

import sys
import warnings
from os.path import abspath, dirname, join


# allow having multiple repository checkouts and not needing to remember to rerun
# 'pip install -e .[dev]' when switching between checkouts and running tests.
__lowerCamelCase      :    Dict   		=   abspath(join(dirname(dirname(__file__)), """src"""))
sys.path.insert(1, git_repo_path)

# silence FutureWarning warnings in tests since often we can't act on them until
# they become normal warnings - i.e. the tests still need to test the current functionality
warnings.simplefilter(action="""ignore""", category=FutureWarning)







def   SCREAMING_SNAKE_CASE       (				snake_case_      :							str     ):
	from diffusers.utils.testing_utils import pytest_addoption_shared

	pytest_addoption_shared(snake_case_     )







def   SCREAMING_SNAKE_CASE       (				snake_case_      :							Any     ):
	from diffusers.utils.testing_utils import pytest_terminal_summary_main

	snake_case__				:   Optional[int]     =						terminalreporter.config.getoption("--make-reports"     )
	if make_reports:
		pytest_terminal_summary_main(snake_case_  ,						id=snake_case_     )



