##// END OF EJS Templates
py3: add a missing b'' in tests/test-newercgi.t...
Pulkit Goyal -
r39763:a2bb0ec3 default
parent child Browse files
Show More
@@ -1,60 +1,60 b''
1 1 #require no-msys # MSYS will translate web paths as if they were file paths
2 2
3 3 This is a rudimentary test of the CGI files as of d74fc8dec2b4.
4 4
5 5 $ hg init test
6 6
7 7 $ cat >hgweb.cgi <<HGWEB
8 8 > #!$PYTHON
9 9 > #
10 10 > # An example CGI script to use hgweb, edit as necessary
11 11 >
12 12 > import cgitb
13 13 > cgitb.enable()
14 14 >
15 15 > from mercurial import demandimport; demandimport.enable()
16 16 > from mercurial.hgweb import hgweb
17 17 > from mercurial.hgweb import wsgicgi
18 18 >
19 19 > application = hgweb(b"test", b"Empty test repository")
20 20 > wsgicgi.launch(application)
21 21 > HGWEB
22 22
23 23 $ chmod 755 hgweb.cgi
24 24
25 25 $ cat >hgweb.config <<HGWEBDIRCONF
26 26 > [paths]
27 27 > test = test
28 28 > HGWEBDIRCONF
29 29
30 30 $ cat >hgwebdir.cgi <<HGWEBDIR
31 31 > #!$PYTHON
32 32 > #
33 33 > # An example CGI script to export multiple hgweb repos, edit as necessary
34 34 >
35 35 > import cgitb
36 36 > cgitb.enable()
37 37 >
38 38 > from mercurial import demandimport; demandimport.enable()
39 39 > from mercurial.hgweb import hgwebdir
40 40 > from mercurial.hgweb import wsgicgi
41 41 >
42 > application = hgwebdir("hgweb.config")
42 > application = hgwebdir(b"hgweb.config")
43 43 > wsgicgi.launch(application)
44 44 > HGWEBDIR
45 45
46 46 $ chmod 755 hgwebdir.cgi
47 47
48 48 $ . "$TESTDIR/cgienv"
49 49 $ "$PYTHON" hgweb.cgi > page1
50 50 $ "$PYTHON" hgwebdir.cgi > page2
51 51
52 52 $ PATH_INFO="/test/"
53 53 $ PATH_TRANSLATED="/var/something/test.cgi"
54 54 $ REQUEST_URI="/test/test/"
55 55 $ SCRIPT_URI="http://hg.omnifarious.org/test/test/"
56 56 $ SCRIPT_URL="/test/test/"
57 57 $ "$PYTHON" hgwebdir.cgi > page3
58 58
59 59 $ grep -i error page1 page2 page3
60 60 [1]
General Comments 0
You need to be logged in to leave comments. Login now