"""Tests for store model.""" import pytest from vectororder.models.store_model import has_hd_encoding_profile, is_hd_only from tests.test_utils.db import ( create_dms_encoding_profile, create_encoding_profile, create_store, ) @pytest.mark.parametrize( ( "test_description", "hd_only", "expected_result", ), [ ( "Store is HD only", "Y", True, ), ( "Store is not HD only", "N", False, ), ], ) def test_is_hd_only( test_description: str, hd_only: str, expected_result: bool, init_db_tables: None, ) -> None: """Test is_hd_only.""" create_store( customer_master_master_id=286, hd_only=hd_only, ) assert is_hd_only(286) == expected_result @pytest.mark.parametrize( ( "test_description", "encoding_profile_id", "dms_encoding_profile_id", "encoding_profile_format", "dms_id", "expected_result", ), [ ( "store encoding profile is HD", 11, 123, "wav24", 1129, True, ), ( "Store encoding profile is not HD", 22, 456, "mp4", 337, False, ), ], ) def test_hd_encoding_profile( test_description: str, encoding_profile_id: int, dms_encoding_profile_id: int, encoding_profile_format: str, dms_id: int, expected_result: bool, init_db_tables: None, ) -> None: """Test is_hd_encoding_profile.""" create_encoding_profile( encoding_profile_id=encoding_profile_id, encoding_profile_format=encoding_profile_format, ) create_dms_encoding_profile( dms_encoding_profile_id=dms_encoding_profile_id, dms_master_master_id=dms_id, encoding_profile_id=encoding_profile_id, ) assert has_hd_encoding_profile(dms_id) == expected_result