@@ -38,6 +38,22 @@ def test_serve_headers(self):
38
38
self .assertEqual (r ['X-RTD-version-Method' ], 'path' )
39
39
self .assertEqual (r ['X-RTD-Path' ], '/proxito/media/html/project/latest/index.html' )
40
40
41
+ def test_subproject_serve_headers (self ):
42
+ r = self .client .get ('/projects/subproject/en/latest/' , HTTP_HOST = 'project.dev.readthedocs.io' )
43
+ self .assertEqual (r .status_code , 200 )
44
+ self .assertEqual (r ['Cache-Tag' ], 'subproject,subproject-latest' )
45
+ self .assertEqual (r ['X-RTD-Domain' ], 'project.dev.readthedocs.io' )
46
+ self .assertEqual (r ['X-RTD-Project' ], 'subproject' )
47
+
48
+ # I think it's not accurate saying that it's `subdomain` the method
49
+ # that we use to get the project slug here, since it was in fact the
50
+ # URL's path but we don't have that feature built
51
+ self .assertEqual (r ['X-RTD-Project-Method' ], 'subdomain' )
52
+
53
+ self .assertEqual (r ['X-RTD-Version' ], 'latest' )
54
+ self .assertEqual (r ['X-RTD-version-Method' ], 'path' )
55
+ self .assertEqual (r ['X-RTD-Path' ], '/proxito/media/html/subproject/latest/index.html' )
56
+
41
57
def test_404_headers (self ):
42
58
r = self .client .get ('/foo/bar.html' , HTTP_HOST = 'project.dev.readthedocs.io' )
43
59
self .assertEqual (r .status_code , 404 )
0 commit comments