From d1a16aaf15aa219aba93b4b7b01b5881c17ccd05 Mon Sep 17 00:00:00 2001 From: Timm Fitschen <t.fitschen@indiscale.com> Date: Fri, 17 Apr 2020 15:47:13 +0200 Subject: [PATCH] TST: fix tests --- misc/ext_bottom_line_test_data.py | 9 ++++++--- test/core/js/modules/entity.xsl.js | 21 --------------------- 2 files changed, 6 insertions(+), 24 deletions(-) diff --git a/misc/ext_bottom_line_test_data.py b/misc/ext_bottom_line_test_data.py index 628465fb..1a43094e 100755 --- a/misc/ext_bottom_line_test_data.py +++ b/misc/ext_bottom_line_test_data.py @@ -25,10 +25,10 @@ import os import caosdb import random -import wget filename = "small.webm" if not os.path.isfile(filename): + import wget #pylint: disable=E0401 filename = wget.download("http://techslides.com/demos/sample-videos/small.webm") caosdb.configure_connection(ssl_insecure=True) @@ -53,13 +53,16 @@ testdata = caosdb.Container() refrec = caosdb.Record("TestPreviewRecord-references").add_parent("TestPreviewRecordType") testdata.append(refrec) -video = caosdb.File(name="TestFile", file=filename, path="testfile.webm") +video = caosdb.File(name="TestFileVideo", file=filename, path="testfile.webm") +image = caosdb.File(name="TestFileImage", + file="../src/core/pics/map_tile_caosdb_logo.png", + path="testfile.png") for i in ["load-forever", "fall-back", "error", "success", "success-2"]: rec = caosdb.Record("TestPreviewRecord-{}".format(i)).add_parent("TestPreviewRecordType") testdata.append(rec) refrec.add_property("TestPreviewRecordType", rec) -#testdate.append(image) +testdata.append(image) testdata.append(video) diff --git a/test/core/js/modules/entity.xsl.js b/test/core/js/modules/entity.xsl.js index a853c365..9b790a00 100644 --- a/test/core/js/modules/entity.xsl.js +++ b/test/core/js/modules/entity.xsl.js @@ -113,27 +113,6 @@ QUnit.test("Property with Permissions tag and type='ExperimentSeries' is recogni assert.equal(link_e.getAttribute("href"), "/entitypath/129950", "href location"); }); -QUnit.test("File path is not converted to lower case.", function(assert) { - let xml_str = '<File path="UPPERCASE.JPG" id="1234"></File>'; - let xml = str2xml(xml_str); - let html = applyTemplates(xml, this.entityXSL, 'entities'); - - // inject an entrance rule - //var xsl_tmp = injectTemplate(this.entityXSL, '<xsl:template match="/"><xsl:apply-templates select="File" mode="top-level-data"/></xsl:template>'); - - - //var params = { - // entitypath: "/entitypath/", - // filesystempath: "/filesystempath/" - //}; - //var html = xslt(xml, xsl, params); - assert.ok(html, "html is ok."); - - var link_e = html.firstElementChild.getElementsByTagName("IMG")[0] - assert.ok(link_e, "<img> tag is there."); - assert.equal(link_e.getAttribute("src"), "/filesystempath/UPPERCASE.JPG", "src location is UPPERCASE.JPG"); -}); - QUnit.test("back references", function(assert) { // inject an entrance rule var xsl = injectTemplate(this.entityXSL, '<xsl:template match="/"><xsl:apply-templates select="*/@id" mode="backreference-link"/></xsl:template>'); -- GitLab