From b3e91ad9f08dcd1fff916c4d1b8cfa3c7d3ca32e Mon Sep 17 00:00:00 2001 From: Paul Lindner Date: Mon, 8 Jan 2018 06:07:31 -0800 Subject: [PATCH] website: fix docHandler test when run via devcam The test added for proper markdown title generation do not work when run via devcam. This is caused by depending on doc/uses.md as the input testdata. devcam does not copy markdown files into the target tmp directory so this test fails when run that way. Solution is create a markdown file in a testdata directory. These are copied to the target tmp directory and the test succeeds. Change-Id: Iae654dca2374b925e6c895a71d4d93b12ccc188b --- website/camweb_test.go | 6 +++--- website/testdata/sample.md | Bin 0 -> 461 bytes 2 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 website/testdata/sample.md diff --git a/website/camweb_test.go b/website/camweb_test.go index 487560485..5d6534ba4 100644 --- a/website/camweb_test.go +++ b/website/camweb_test.go @@ -103,10 +103,10 @@ func TestDocHandler(t *testing.T) { wantSubstr string }{ // Test that the title tag is constructed from the h1 element - {"/doc/uses", http.StatusOK, - "Use Cases - Perkeep"}, + {"/website/testdata/sample", http.StatusOK, + "Lorem Ipsum - Perkeep"}, // Test that an html extension redirects to the base path - {"/doc/uses.html", 302, "Found"}, + {"/website/testdata/sample.html", 302, "Found"}, } for _, tt := range tests { diff --git a/website/testdata/sample.md b/website/testdata/sample.md new file mode 100644 index 0000000000000000000000000000000000000000..976d0ffa5d03c11f069e9cca1c66aaeaee9b4cc8 GIT binary patch literal 461 zcmXw#O-@5G421VN#Yk+ccM4b_vE=|Jaf_w=HMXlBABP9KjAD;xz88Fq#SQOMy`^*t z*#c$Mv7ln0#&$s-T{#<@FHn&wnx)^sRpL{*#6n_mZKJ@r%~+P6rAYB^a6_f9xCOS; zn$hUi2~_3obl}s#U0QgjCj0RSN$rBWi=q#;U0w=sQrFv_kkg@b=6+jRTlUFc>)#=a|brrBJv=t&X{d6z-eiCKV~N*GaoK#`P*$ X2!)l`{%xb~7_