<commit_before>/**
 * XadillaX <<EMAIL>> created at 2017-12-03 14:46:14 with ❤
 *
 * Copyright (c) 2017 xcoder.in, all rights reserved.
 */
"use strict";

const assert = require("assert");

const cheerio = require("cheerio");
const spidex = require("spidex");

const constellation = require("../");

const days = [ 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ];

describe("constellation", function() {
    for(let i = 0; i < 12; i++) {
        for(let j = 0; j < days[i]; j++) {
            it(`${i + 1}.${j + 1} should OK`, function(done) {
                spidex.post("http://www.xzw.com/cquery/post.php", {
                    data: {
                        "date[0]": 2004,
                        "date[1]": i + 1,
                        "date[2]": j + 1
                    },
                    header: {
                        Host: "www.xzw.com"
                    },
                    timeout: 10000
                }, function(html, status, header) {
                    if(status !== 302) {
                        throw new Error("not 302");
                    }

                    const url = `http://www.xzw.com${header.location}`;
                    spidex.get(url, {
                        timeout: 10000
                    }, function(html) {
                        const $ = cheerio.load(html);
                        const standard = $(".sContent h2").text();

                        assert.equal(constellation(i + 1, j + 1, "zh-cn"), standard);<commit_msg>test: update timeout<commit_after>/**
 * XadillaX <<EMAIL>> created at 2017-12-03 14:46:14 with ❤
 *
 * Copyright (c) 2017 xcoder.in, all rights reserved.
 */
"use strict";

const assert = require("assert");

const cheerio = require("cheerio");
const spidex = require("spidex");

const constellation = require("../");

const days = [ 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ];

describe("constellation", function() {
    for(let i = 0; i < 12; i++) {
        for(let j = 0; j < days[i]; j++) {
            it(`${i + 1}.${j + 1} should OK`, function(done) {
                this.timeout(20000);

                spidex.post("http://www.xzw.com/cquery/post.php", {
                    data: {
                        "date[0]": 2004,
                        "date[1]": i + 1,
                        "date[2]": j + 1
                    },
                    header: {
                        Host: "www.xzw.com"
                    },
                    timeout: 10000
                }, function(html, status, header) {
                    if(status !== 302) {
                        throw new Error("not 302");
                    }

                    const url = `http://www.xzw.com${header.location}`;
                    spidex.get(url, {
                        timeout: 10000
                    }, function(html) {
                        const $ = cheerio.load(html);
                        const standard = $(".sContent h2").text();

                        assert.equal(constellation(i + 1, j + 1, "zh-cn"), standard);
{'fraction_non_alphanumeric': 0.1550872571616727, 'fraction_numerical': 0.051695752387224236, 'mean_word_length': 1.2570579494799405, 'pattern_counts': {'":': 6, '<': 11, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 6, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1010806', 'n_tokens_mistral': 1042, 'n_tokens_neox': 850, 'n_words': 216}