Skip to content
Snippets Groups Projects
Verified Commit d1a16aaf authored by Timm Fitschen's avatar Timm Fitschen
Browse files

TST: fix tests

parent f1c51513
No related branches found
No related tags found
No related merge requests found
......@@ -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)
......
......@@ -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>');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment