Debian Codegraph @

tests/test_coverup_100.py

raw symbols SCIP
1 # file scalene/launchbrowser.py:20-22
2 # lines [20, 21, 22]
3 # branches []
4
5 import os
6 import pathlib
7 import pytest
8 from scalene.launchbrowser import read_file_content
9
10
11 @pytest.fixture
12 def temp_test_directory(tmp_path):
13 # Create a temporary directory structure
14 directory = tmp_path / "test_dir"
15 subdirectory = directory / "sub_dir"
16 subdirectory.mkdir(parents=True)
17 # Create a test file
18 test_file = subdirectory / "test_file.txt"
19 test_file.write_text("Test content")
20 return str(directory), "sub_dir", "test_file.txt"
21
22
23 def test_read_file_content(temp_test_directory):
24 directory, subdirectory, filename = temp_test_directory
25 # Read the content using the function
26 content = read_file_content(directory, subdirectory, filename)
27 # Assert that the content matches what we expect
28 assert content == "Test content"