<commit_before>var expect  = require('chai').expect;
var Request = require('request');
var OAuth   = require('../../oauth-1.0a');
var crypto = require('crypto');

describe("Openbank Personal Consumer", function() {
    this.timeout(10000);

    var oauth = new OAuth({
        consumer: {
            key: process.env.OPENBANK_CONSUMER_PUBLIC,
            secret: process.env.OPENBANK_CONSUMER_SECRET
        },
        signature_method: 'HMAC-SHA256',
        hash_function: function(base_string, key) {
            return crypto.createHmac('sha256', key).update(base_string).digest('base64');
        }
    });

    //need to send as header
    describe("#Request Token", function() {
        var request = {
            url:    'https://apisandbox.openbankproject.com/oauth/initiate',
            method: 'POST',
            data: {
                oauth_callback: 'http://www.ddo.me'
            }
        };

        it("should be a valid response", function(done) {
            Request({
                url:        request.url,
                method:     request.method,
                form:       request.data,
                headers:    oauth.toHeader(oauth.authorize(request))
            }, function(err, res, body) {
                expect(body).to.be.a('string');

                body = oauth.deParam(body);

                expect(body).to.have.property('oauth_callback_confirmed', 'true');
                expect(body).to.have.property('oauth_token');
                expect(body).to.have.property('oauth_token_secret');

                done();
            });
        });
    });
});<commit_msg>skip Openbank test<commit_after>var expect  = require('chai').expect;
var Request = require('request');
var OAuth   = require('../../oauth-1.0a');
var crypto = require('crypto');

describe.skip("Openbank Personal Consumer", function() {
    this.timeout(10000);

    var oauth = new OAuth({
        consumer: {
            key: process.env.OPENBANK_CONSUMER_PUBLIC,
            secret: process.env.OPENBANK_CONSUMER_SECRET
        },
        signature_method: 'HMAC-SHA256',
        hash_function: function(base_string, key) {
            return crypto.createHmac('sha256', key).update(base_string).digest('base64');
        }
    });

    //need to send as header
    describe("#Request Token", function() {
        var request = {
            url:    'https://apisandbox.openbankproject.com/oauth/initiate',
            method: 'POST',
            data: {
                oauth_callback: 'http://www.ddo.me'
            }
        };

        it("should be a valid response", function(done) {
            Request({
                url:        request.url,
                method:     request.method,
                form:       request.data,
                headers:    oauth.toHeader(oauth.authorize(request))
            }, function(err, res, body) {
                expect(body).to.be.a('string');

                body = oauth.deParam(body);

                expect(body).to.have.property('oauth_callback_confirmed', 'true');
                expect(body).to.have.property('oauth_token');
                expect(body).to.have.property('oauth_token_secret');

                done();
            });
        });
    });
});
{'fraction_non_alphanumeric': 0.1391116594694633, 'fraction_numerical': 0.009253547193090685, 'mean_word_length': 1.8151041666666667, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '3276747', 'n_tokens_mistral': 964, 'n_tokens_neox': 897, 'n_words': 156}