-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
52 lines (44 loc) · 1.16 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
def create_index_html_file():
file_path = "index.html"
content = """
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Meta tags, title, and CSS link -->
</head>
<body>
<!-- Your iframe and other body content -->
</body>
</html>
"""
with open(file_path, "w") as file:
file.write(content)
create_index_html_file()
```
Unit Test:
```python
def test_create_index_html_file():
# Create a temporary directory for testing
with tempfile.TemporaryDirectory() as temp_dir:
# Set the current working directory to the temporary directory
os.chdir(temp_dir)
# Call the function to create the index.html file
create_index_html_file()
# Check if the index.html file exists
assert os.path.exists("index.html")
# Read the content of the index.html file
with open("index.html", "r") as file:
content = file.read()
# Check if the content is correct
assert content.strip() == """
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Meta tags, title, and CSS link -->
</head>
<body>
<!-- Your iframe and other body content -->
</body>
</html>
""".strip()
test_create_index_html_file()