Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jan 5, 2025
1 parent 455629a commit 7ed60e3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/test_backend/test_directx/test_preprocessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,20 @@
from crosstl.backend.DirectX.DirectxParser import HLSLParser
from crosstl.backend.DirectX.DirectxCrossGLCodeGen import HLSLToCrossGLConverter


@pytest.fixture
def converter():
return HLSLToCrossGLConverter()


# Mocking the handle_include method to bypass file system checks
@patch('crosstl.backend.Directx.DirectxPreprocessor.DirectxPreprocessor.handle_include')
@patch("crosstl.backend.Directx.DirectxPreprocessor.DirectxPreprocessor.handle_include")
def test_include_directive(mock_handle_include, converter):
# Mock the content that would be returned from the #include directive
mock_handle_include.return_value = "// Mocked content of common.hlsl"

shader_code = '#include "common.hlsl"\nfloat4 main() : SV_Target { return 0; }'

# Expected output should include the mocked content
expected_output = (
"// Mocked content of common.hlsl\nfloat4 main() : SV_Target { return 0; }"
Expand All @@ -27,4 +29,4 @@ def test_include_directive(mock_handle_include, converter):
output = converter.convert(ast)

# Check if the mocked content is part of the output
assert "// Mocked content of common.hlsl" in output
assert "// Mocked content of common.hlsl" in output

0 comments on commit 7ed60e3

Please sign in to comment.