<commit_before>// Copyright 2012 Joyent, Inc.  All rights reserved.

var Logger = require('bunyan'),
    restify = require('restify'),
    uuid = require('node-uuid'),
    IMGAPI = require('../lib/index').IMGAPI,
    util = require('util');


// --- Globals

var IMGAPI_URL = 'https://datasets.joyent.com';

var imgapi, IMAGES;

exports.setUp = function (callback) {
    var logger = new Logger({
            name: 'imgapi_unit_test',
            stream: process.stderr,
            level: (process.env.LOG_LEVEL || 'info'),
            serializers: Logger.stdSerializers
    });

    imgapi = new IMGAPI({
        url: IMGAPI_URL,
        retry: {
            retries: 1,
            minTimeout: 1000
        },
        log: logger
    });

    callback();
};


exports.test_list_images = function (t) {
    imgapi.listImages(function (err, images) {<commit_msg>RELENG-386: use the given IMGAPI_URL from runtests<commit_after>// Copyright 2012 Joyent, Inc.  All rights reserved.

var Logger = require('bunyan'),
    restify = require('restify'),
    uuid = require('node-uuid'),
    IMGAPI = require('../lib/index').IMGAPI,
    util = require('util');


// --- Globals

var IMGAPI_URL = process.env.IMGAPI_URL || 'https://datasets.joyent.com';

var imgapi, IMAGES;

exports.setUp = function (callback) {
    var logger = new Logger({
            name: 'imgapi_unit_test',
            stream: process.stderr,
            level: (process.env.LOG_LEVEL || 'info'),
            serializers: Logger.stdSerializers
    });

    imgapi = new IMGAPI({
        url: IMGAPI_URL,
        retry: {
            retries: 1,
            minTimeout: 1000
        },
        log: logger
    });

    callback();
};


exports.test_list_images = function (t) {
    imgapi.listImages(function (err, images) {
{'fraction_non_alphanumeric': 0.13974287311347122, 'fraction_numerical': 0.011738401341531582, 'mean_word_length': 2.33955223880597, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '6232154', 'n_tokens_mistral': 589, 'n_tokens_neox': 562, 'n_words': 129}