Mercurial > hg > orthanc
comparison UnitTestsSources/LuaTests.cpp @ 2363:f8ef157f2d73
fix unit tests given www.orthanc-server.com now mandatory uses HTTPS
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 21 Aug 2017 15:04:20 +0200 |
parents | a3a65de1840f |
children | 883387e2b379 |
comparison
equal
deleted
inserted
replaced
2362:f47fd47b3c91 | 2363:f8ef157f2d73 |
---|---|
285 | 285 |
286 TEST(Lua, Http) | 286 TEST(Lua, Http) |
287 { | 287 { |
288 Orthanc::LuaContext lua; | 288 Orthanc::LuaContext lua; |
289 | 289 |
290 #if UNIT_TESTS_WITH_HTTP_CONNEXIONS == 1 | 290 #if UNIT_TESTS_WITH_HTTP_CONNEXIONS == 1 |
291 lua.Execute("JSON = loadstring(HttpGet('http://www.orthanc-server.com/downloads/third-party/JSON.lua')) ()"); | 291 // It is not guaranteed that the URL on server |
292 const std::string url("http://www.orthanc-server.com/downloads/third-party/Product.json"); | 292 // "www.montefiore.ulg.ac.be" will work forever. We switched to it, |
293 // as the "www.orthanc-server.com" now mandatory uses HTTPS. | |
294 const std::string BASE = "http://www.montefiore.ulg.ac.be/~jodogne/Orthanc/ThirdPartyDownloads/"; | |
295 //const std::string BASE = "http://www.orthanc-server.com/downloads/third-party/"; | |
296 | |
297 lua.Execute("JSON = loadstring(HttpGet('" + BASE + "JSON.lua')) ()"); | |
298 const std::string url(BASE + "Product.json"); | |
293 #endif | 299 #endif |
294 | 300 |
295 std::string s; | 301 std::string s; |
296 lua.Execute(s, "print(HttpGet({}))"); | 302 lua.Execute(s, "print(HttpGet({}))"); |
297 ASSERT_EQ("nil", Orthanc::Toolbox::StripSpaces(s)); | 303 ASSERT_EQ("nil", Orthanc::Toolbox::StripSpaces(s)); |