Unit tests have been fixed (#249)

* Fixed unit tests
* Added copyright
main
Boris Sekachev 7 years ago committed by Nikita Manovich
parent 76c95db808
commit ac97df8343

@ -6,8 +6,6 @@
/* exported
ExportType
IncrementIdGenerator
ConstIdGenerator
confirm
createExportContainer
dumpAnnotationRequest
@ -245,30 +243,6 @@ function getExportTargetContainer(export_type, shape_type, container) {
return shape_container_target;
}
class IncrementIdGenerator {
constructor(startId=0) {
this._startId = startId;
}
next() {
return this._startId++;
}
reset(startId=0) {
this._startId = startId;
}
}
class ConstIdGenerator {
constructor(startId=-1) {
this._startId = startId;
}
next() {
return this._startId;
}
}
/* These HTTP methods do not require CSRF protection */
function csrfSafeMethod(method) {
return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method));

@ -0,0 +1,36 @@
/*
* Copyright (C) 2018 Intel Corporation
*
* SPDX-License-Identifier: MIT
*/
/* exported
IncrementIdGenerator
ConstIdGenerator
*/
"use strict";
class IncrementIdGenerator {
constructor(startId=0) {
this._startId = startId;
}
next() {
return this._startId++;
}
reset(startId=0) {
this._startId = startId;
}
}
class ConstIdGenerator {
constructor(startId=-1) {
this._startId = startId;
}
next() {
return this._startId;
}
}

File diff suppressed because it is too large Load Diff

@ -37,6 +37,7 @@
{% compress js file cvat %}
{% block head_js_cvat %}
<script type="text/javascript" src="{% static 'engine/js/base.js' %}"></script>
<script type="text/javascript" src="{% static 'engine/js/idGenerator.js' %}"></script>
<script type="text/javascript" src="{% static 'engine/js/userConfig.js' %}"></script>
{% endblock %}
{% endcompress %}

@ -52,6 +52,7 @@ module.exports = {
'createExportContainer': true,
'ExportType': true,
'getExportTargetContainer': true,
// from idGenerator.js
'IncrementIdGenerator': true,
'ConstIdGenerator': true,
// from shapeCollection.js

@ -10,6 +10,7 @@ module.exports = function(config) {
basePath: path.join(process.env.HOME, 'cvat/apps/'),
frameworks: ['qunit'],
files: [
'engine/static/engine/js/idGenerator.js',
'engine/static/engine/js/labelsInfo.js',
'engine/static/engine/js/annotationParser.js',
'engine/static/engine/js/listener.js',

Loading…
Cancel
Save