CHG update tests with new endpoints
@@ -15,7 +15,7 @@ def test_visuals_public_course():
# Get the course visual
usage = student.get(
- f"/public/visuals/usage/{course_id}",
+ f"/public/visuals/course/{course_id}",
return_request=True,
skip_verify=True,
)
@@ -30,7 +30,7 @@ def test_visuals_public_playgrounds():
# Get the course visual
usage = student.get(
- f"/public/visuals/usage/playgrounds",
+ f"/public/visuals/playgrounds",
return_request=True,
skip_verify=True,
)
@@ -43,9 +43,10 @@ def test_visuals_public_playgrounds():
def test_visuals_public_active():
student = Session("student")
+ for days, step in [(14, 1), (90, 7), (180, 1), (365, 30)]:
# Get the course visual
usage = student.get(
- f"/public/visuals/usage/active",
+ f"/public/visuals/active/{days}/{step}",
return_request=True,
skip_verify=True,
)
@@ -53,3 +54,20 @@ def test_visuals_public_active():
# Just make sure it didn't 500
assert usage.headers['Content-Type'] == 'image/png'
assert usage.status_code == 200
+
+
+def test_visuals_public_users():
+ student = Session("student")
+
+ for days, step in [(365, 1), (365, 30)]:
+ # Get the course visual
+ r = student.get(
+ f"/public/visuals/users/{days}/{step}",
+ return_request=True,
+ skip_verify=True,
+ )
+
+ # Just make sure it didn't 500
+ print('aaa', r.content)
+ assert r.headers['Content-Type'] == 'image/png'
+ assert r.status_code == 200
