<commit_before>'use strict';

var assert = require('assert');
var testHelper = require('../helper');


describe('contour', function () {

    var QUERY_AIRBNB_ROOMS = 'select * from airbnb_rooms';

    var analysisDefinition = {
        type: 'contour',
        params: {
            source: {
                type: 'source',
                params: {
                    query: QUERY_AIRBNB_ROOMS
                }
            },
            column: 'price',
            buffer: 0.2,
            method: 'barymetric',
            class_method: 'quantiles',
            steps: 7,
            resolution: 250
        }
    };

    it('basic contour test', function (done) {
        testHelper.createAnalyses(analysisDefinition, function (err, analysisResult) {
            if (err) {
                return done(err);
            }

            testHelper.getRows(analysisResult.getQuery(), function (err, rows) {
                if (err) {
                    return done(err);
                }
                assert.equal(rows.length, analysisDefinition.params.steps);
                return done();
            });
        });
    });

});<commit_msg>assert cartodb_id and the_geom<commit_after>'use strict';

var assert = require('assert');
var testHelper = require('../helper');


describe('contour', function () {

    var QUERY_AIRBNB_ROOMS = 'select * from airbnb_rooms';

    var analysisDefinition = {
        type: 'contour',
        params: {
            source: {
                type: 'source',
                params: {
                    query: QUERY_AIRBNB_ROOMS
                }
            },
            column: 'price',
            buffer: 0.2,
            method: 'barymetric',
            class_method: 'quantiles',
            steps: 7,
            resolution: 250
        }
    };

    it('basic contour test', function (done) {
        testHelper.createAnalyses(analysisDefinition, function (err, analysisResult) {
            if (err) {
                return done(err);
            }

            testHelper.getRows(analysisResult.getQuery(), function (err, rows) {
                if (err) {
                    return done(err);
                }
                assert.equal(rows.length, analysisDefinition.params.steps);
                assert.ok(typeof row.cartodb_id === 'number');
                assert.ok(typeof row.the_geom === 'string');
                return done();
            });
        });
    });

});
{'fraction_non_alphanumeric': 0.11831905344757242, 'fraction_numerical': 0.004895960832313341, 'mean_word_length': 1.437375745526839, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5365706', 'n_tokens_mistral': 690, 'n_tokens_neox': 635, 'n_words': 135}