<commit_before>'use strict';

import chai from 'chai';
import {Instance} from '../../lib.compiled/Resource/Instance';
import {MissingActionException} from '../../lib.compiled/Exception/MissingResourceException';
import {Action} from '../../lib.compiled/Resource/Action';

suite('Resource/Instance', function() {
  let actionName = 'UpdateData';
  let rawActions = ['find', 'update'];
  let instance = new Instance(actionName, rawActions);
  let defaultSecurityCredentials = {
    accessKeyId: null,
    secretAccessKey: null,
    sessionToken: null,
  };

  test('Class Instance exists in Resource/Instance', function() {
    chai.expect(typeof Instance).to.equal('function');
  });

  test('Check constructor sets _name', function() {
    chai.expect(instance.name).to.be.equal(actionName);
  });

  test('Check constructor sets _rawActions', function() {
    chai.expect(instance._rawActions).to.be.equal(rawActions);
  });

  test('Check constructor sets securityCredentials', function() {
    chai.expect(instance.securityCredentials).to.be.eql(defaultSecurityCredentials);
  });

  test('Check constructor sets _actions', function() {
    chai.expect(Object.keys(instance.actions).length).to.be.equal(2);
  });

  test('Check constructor sets _localBackend=false', function() {
    chai.expect(instance.localBackend).to.be.equal(false);
  });

  test('Check constructor sets _cache=null', function() {
    chai.expect(instance.cache).to.be.equal(null);
  });

  test('Check cache() setter sets _cache={}', function() {
    instance.cache = null;
    chai.expect(instance.cache).to.be.equal(null);
    instance.cache = {};
    chai.expect(instance.cache).to.be.eql({});
  });

  test('Check localBackend() setter sets _cache={}', function() {
    instance.localBackend = false;
    chai.expect(instance.localBackend).to.be.equal(false);
    instance.localBackend = true;
    chai.expect(instance.localBackend).to.be.equal(true);
  });

  test('Check cache() setter sets securityCredentials={}', function() {
    let securityCredentials = {
      accessKeyId: 'test_accessKeyId',
      secretAccessKey: 'test_secretAccessKey',
      sessionToken: '<PASSWORD>',
    };
    chai.expect(instance.securityCredentials).to.be.eql(defaultSecurityCredentials);
    instance.securityCredentials = securityCredentials;
    chai.expect(instance.securityCredentials).to.be.eql(securityCredentials);
  });

  test('Check has() method returns false', function() {
    chai.expect(instance.has('find')).to.be.equal(false);
  });<commit_msg>adjust deep-resource tests<commit_after>'use strict';

import chai from 'chai';
import {Instance} from '../../lib.compiled/Resource/Instance';
import {MissingActionException} from '../../lib.compiled/Exception/MissingResourceException';
import {Action} from '../../lib.compiled/Resource/Action';

suite('Resource/Instance', function() {
  let actionName = 'UpdateData';
  let rawActions = ['find', 'update'];
  let instance = new Instance(actionName, rawActions);

  test('Class Instance exists in Resource/Instance', function() {
    chai.expect(typeof Instance).to.equal('function');
  });

  test('Check constructor sets _name', function() {
    chai.expect(instance.name).to.be.equal(actionName);
  });

  test('Check constructor sets _rawActions', function() {
    chai.expect(instance._rawActions).to.be.equal(rawActions);
  });

  test('Check constructor sets _security=null', function() {
    chai.expect(instance.security).to.be.eql(null);
  });

  test('Check constructor sets _actions', function() {
    chai.expect(Object.keys(instance.actions).length).to.be.equal(2);
  });

  test('Check constructor sets _localBackend=false', function() {
    chai.expect(instance.localBackend).to.be.equal(false);
  });

  test('Check constructor sets _cache=null', function() {
    chai.expect(instance.cache).to.be.equal(null);
  });

  test('Check cache() setter sets _cache={}', function() {
    instance.cache = null;
    chai.expect(instance.cache).to.be.equal(null);
    instance.cache = {};
    chai.expect(instance.cache).to.be.eql({});
  });

  test('Check localBackend() setter sets _localBackend=true', function() {
    instance.localBackend = false;
    chai.expect(instance.localBackend).to.be.equal(false);
    instance.localBackend = true;
    chai.expect(instance.localBackend).to.be.equal(true);
  });

  test('Check security() setter sets _security={}', function() {
    instance.security = null;
    chai.expect(instance.security).to.be.equal(null);
    instance.security = {};
    chai.expect(instance.security).to.be.eql({});
  });

  test('Check has() method returns false', function() {
    chai.expect(instance.has('find')).to.be.equal(false);
  });
{'fraction_non_alphanumeric': 0.16656030631780472, 'fraction_numerical': 0.00042544139544777704, 'mean_word_length': 4.492990654205608, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, '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': '2224656', 'n_tokens_mistral': 1403, 'n_tokens_neox': 1421, 'n_words': 251}