<commit_before>/*
This file is part of the Juju GUI, which lets users view and manage Juju
environments within a graphical interface (https://launchpad.net/juju-gui).
Copyright (C) 2014 Canonical Ltd.

This program is free software: you can redistribute it and/or modify it under
the terms of the GNU Affero General Public License version 3, as published by
the Free Software Foundation.

This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Affero
General Public License for more details.

You should have received a copy of the GNU Affero General Public License along
with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

'use strict';

(function() {

  describe('Zip utils', function() {
    var testUtils, Y, ziputils;
    var requirements = ['juju-tests-utils', 'zip-utils'];

    before(function(done) {
      // Set up the YUI instance, the test utils and the zip namespace.
      Y = YUI(GlobalConfig).use(requirements, function(Y) {
        testUtils = Y.namespace('juju-tests.utils');
        ziputils = Y.namespace('juju.ziputils');
        done();
      });
    });

    describe('getEntries', function() {
      var callback, errback;
      var createReaderMock;
      var file = 'a file object';

      beforeEach(function() {
        // Patch the zip library.
        createReaderMock = testUtils.makeStubMethod(zip, 'createReader');
        // Set up the callback and errback mocks.
        callback = sinon.stub();
        errback = sinon.stub();
      });

      afterEach(function() {
        createReaderMock.reset();
      });

      // Return an object including the arguments passed when calling the<commit_msg>Replace makeStubMethod with sinon.stub in the zip utils tests.<commit_after>/*
This file is part of the Juju GUI, which lets users view and manage Juju
environments within a graphical interface (https://launchpad.net/juju-gui).
Copyright (C) 2014 Canonical Ltd.

This program is free software: you can redistribute it and/or modify it under
the terms of the GNU Affero General Public License version 3, as published by
the Free Software Foundation.

This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Affero
General Public License for more details.

You should have received a copy of the GNU Affero General Public License along
with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

'use strict';

(function() {

  describe('Zip utils', function() {
    let Y, ziputils;
    var requirements = ['zip-utils'];

    before(function(done) {
      // Set up the YUI instance, the test utils and the zip namespace.
      Y = YUI(GlobalConfig).use(requirements, function(Y) {
        ziputils = Y.namespace('juju.ziputils');
        done();
      });
    });

    describe('getEntries', function() {
      var callback, errback;
      var createReaderMock;
      var file = 'a file object';

      beforeEach(function() {
        // Patch the zip library.
        createReaderMock = sinon.stub(zip, 'createReader');
        // Set up the callback and errback mocks.
        callback = sinon.stub();
        errback = sinon.stub();
      });

      afterEach(function() {
        createReaderMock.restore();
      });

      // Return an object including the arguments passed when calling the
{'fraction_non_alphanumeric': 0.09248393405979324, 'fraction_numerical': 0.002794076557697681, 'mean_word_length': 3.1102181400688864, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '4143811', 'n_tokens_mistral': 983, 'n_tokens_neox': 949, 'n_words': 399}