Skip to content

Commit 32adb72

Browse files
committed
fix mac
1 parent 8f05cbd commit 32adb72

File tree

3 files changed

+22
-11
lines changed

3 files changed

+22
-11
lines changed

BUILD.bazel

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,20 @@ load("@pip_deps//:requirements.bzl", "requirement")
88
load("//book/htmlbook/tools/python:defs.bzl", "rt_py_library", "rt_py_test")
99
load("@pip_deps//:requirements.bzl", "requirement")
1010

11+
rt_py_library(
12+
name = "htmlbook",
13+
srcs = [
14+
"__init__.py",
15+
"book_name.py"
16+
],
17+
imports = [".."],
18+
data = [
19+
"//:pyproject.toml",
20+
],
21+
visibility = ["//visibility:public"],
22+
)
23+
24+
1125
rt_py_test(
1226
name = "install_html_meta_data",
1327
srcs = [
@@ -41,20 +55,12 @@ rt_py_test(
4155
tags = ["requires-network"],
4256
)
4357

44-
rt_py_library(
45-
name = "book_name",
46-
srcs = ["book_name.py"],
47-
data = [
48-
"//:pyproject.toml",
49-
],
50-
visibility = ["//visibility:public"],
51-
)
5258

5359
rt_py_test(
5460
name = "check_website",
5561
srcs = ["check_website.py"],
5662
deps = [
57-
":book_name",
63+
":htmlbook",
5864
requirement("requests"),
5965
],
6066
tags = ["requires-network"],

__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Blank file to mark directory as Python package

check_website.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
import requests
2-
from book_name import get_project_name
2+
from htmlbook.book_name import get_project_name
3+
34

45
def test_website_up():
56
url = f"http://{get_project_name()}.mit.edu/python/index.html"
67
response = requests.get(url)
7-
assert response.status_code == 200, f"Website {url} returned status code {response.status_code}"
8+
assert (
9+
response.status_code == 200
10+
), f"Website {url} returned status code {response.status_code}"
11+
812

913
if __name__ == "__main__":
1014
test_website_up()

0 commit comments

Comments
 (0)