Skip to content

Commit 316b2da

Browse files
committed
Fix LocalRepo2dockerBuild version check
1 parent a822ce1 commit 316b2da

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

binderhub/tests/test_main.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""Test main handlers"""
22

3+
import re
34
import time
45
from urllib.parse import quote, urlparse
56

@@ -8,6 +9,8 @@
89
from bs4 import BeautifulSoup
910

1011
from binderhub import __version__ as binder_version
12+
from binderhub.build import KubernetesBuildExecutor
13+
from binderhub.build_local import LocalRepo2dockerBuild
1114

1215
from .utils import async_requests
1316

@@ -103,12 +106,18 @@ async def test_about_handler(app):
103106

104107
@pytest.mark.remote
105108
async def test_versions_handler(app):
109+
print(app.build_class == LocalRepo2dockerBuild)
110+
106111
# Check that the about page loads
107112
r = await async_requests.get(app.url + "/versions")
108113
assert r.status_code == 200
109114

110115
data = r.json()
111-
assert data["builder"] == app.build_image
116+
# Versions is different for KubernetesExecutor and LocalRepo2dockerBuild
117+
if app.build_class == KubernetesBuildExecutor:
118+
assert data["builder"] == app.build_image
119+
else:
120+
assert re.match(r"\d+\.\d+\.\d+(-\w+)?$", data["builder"])
112121
assert data["binderhub"].split("+")[0] == binder_version.split("+")[0]
113122

114123

0 commit comments

Comments
 (0)