<commit_before>var request = require('request');
var saram = require('saram-core');
var userModule = require('saram-core/modules/user/index.js');
var Call = require('saram-core/system/call/index.js');
var EventContext = require('saram-core/system/eventcontext/index.js');

describe('Basic Module Test', function() {
    describe('User', function() {
        var server = null;

        it('#Start', function(done) {
            server = saram();
            server.cache.addNode("memory:///");
            server.db.addNode("mysql://travis@127.0.0.1/saram_test");
            server.load(userModule);    

            server.use('elab.user', 'user');
            server.weld('user','users');
            server.protocol.addProtocol("http", { port : 7000 });

            server.start(done);
        });

        var access_token = "";

        it('#Signin', function(done) {
            Call.post(new EventContext(server, "saram.test.user", {}), "/users/signin", {data:{uuid:"1111"}}, function(obj) {
                access_token = obj.access_token;
                done(!obj.access_token ? new Error("Access Token 할당 실패") : undefined);
            });
        });

        it('#My UUID(GET UUID)', function(done) {
            request.get('http://1172.16.58.3:7000/users/my_uuid?access_token='+access_token, function (error, response, body) {
                if(response.statusCode!=200) {
                    done(new Error(body));
                    return;
                }<commit_msg>User 모듈 테스트코드 수정<commit_after>var request = require('request');
var saram = require('saram-core');
var userModule = require('saram-core/modules/user/index.js');
var Call = require('saram-core/system/call/index.js');
var EventContext = require('saram-core/system/eventcontext/index.js');

describe('Basic Module Test', function() {
    describe('User', function() {
        var server = null;

        it('#Start', function(done) {
            server = saram();
            server.cache.addNode("memory:///");
            server.db.addNode("mysql://travis@127.0.0.1/saram_test");
            server.load(userModule);    

            server.use('elab.user', 'user');
            server.weld('user','users');
            server.modules.addReceiver("user", "call.my_uuid.before", "user", "auth");

            server.protocol.addProtocol("http", { port : 7000 });

            server.start(done);
        });

        var access_token = "";

        it('#Signin', function(done) {
            Call.post(new EventContext(server, "saram.test.user", {}), "/users/signin", {data:{uuid:"1111"}}, function(obj) {
                access_token = obj.access_token;
                done(!obj.access_token ? new Error("Access Token 할당 실패") : undefined);
            });
        });

        it('#My UUID(GET UUID)', function(done) {
            request.get('http://127.0.0.1:7000/users/my_uuid?access_token='+access_token, function (error, response, body) {
                if(response.statusCode!=200) {
                    done(new Error(body));
                    return;
                }
{'fraction_non_alphanumeric': 0.16938110749185667, 'fraction_numerical': 0.018566775244299675, 'mean_word_length': 2.277481323372465, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, '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': '4508022', 'n_tokens_mistral': 953, 'n_tokens_neox': 914, 'n_words': 147}