Skip to content

Commit

Permalink
Unit tests have been fixed (#249)
Browse files Browse the repository at this point in the history
* Fixed unit tests
* Added copyright
  • Loading branch information
bsekachev authored and nmanovic committed Dec 25, 2018
1 parent 76c95db commit ac97df8
Show file tree
Hide file tree
Showing 6 changed files with 522 additions and 380 deletions.
26 changes: 0 additions & 26 deletions cvat/apps/engine/static/engine/js/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

/* exported
ExportType
IncrementIdGenerator
ConstIdGenerator
confirm
createExportContainer
dumpAnnotationRequest
Expand Down Expand Up @@ -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));
Expand Down
36 changes: 36 additions & 0 deletions cvat/apps/engine/static/engine/js/idGenerator.js
Original file line number Diff line number Diff line change
@@ -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;
}
}
Loading

0 comments on commit ac97df8

Please sign in to comment.