<commit_before>'use strict';

import chai from 'chai';
import {SharedCache} from '../lib/SharedCache';
import {AbstractDriver} from '../lib/Driver/AbstractDriver';
import {AbstractDriverMock} from './Mocks/AbstractDriverMock';
import {Request} from '../node_modules/deep-core/lib.compiled/AWS/Lambda/Request';

suite('SharedCache', () => {
  let abstractDriver = new AbstractDriverMock();
  let data = {firstKey: 'firstValue'};
  let request = new Request(data);

  test('Class SharedCache exists in SharedCache', () => {
    chai.expect(SharedCache).to.be.an('function');
  });

  test('Test SharedCache buildKeyFromRequest() === buildKeyFromLambdaRuntime()', () => {
    let arn = 'arn:aws:lambda:us-west-2:9283468276298:function:test_backend';

    let sharedCache = new SharedCache(abstractDriver);

    let requestCacheKey = sharedCache.buildKeyFromRequest({
      isLambda: true,
      payload: {id1: 'blabla', id3: 'uhuhu', arr: [3, 6, 9], o2: {hey: 's', hey5: 'm'}},
      action: {
        source: {
          original: arn,
        },
      },
    });

    let runtimeCacheKey = sharedCache.buildKeyFromLambdaRuntime({
      context: {
        has: () => true,
        getOption: () => arn,
      },
      request: {
        data: {id1: 'blabla', o2: {hey5: 'm', hey: 's'}, id3: 'uhuhu', arr: [3, 9, 6]},
      },
    });

    chai.expect(requestCacheKey).to.equal(runtimeCacheKey);
  });
});
<commit_msg>Fix hound issues<commit_after>'use strict';

import chai from 'chai';
import {SharedCache} from '../lib/SharedCache';
import {AbstractDriverMock} from './Mocks/AbstractDriverMock';
import {Request} from '../node_modules/deep-core/lib.compiled/AWS/Lambda/Request';

suite('SharedCache', () => {
  let abstractDriver = new AbstractDriverMock();
  let data = {firstKey: 'firstValue'};

  test('Class SharedCache exists in SharedCache', () => {
    chai.expect(SharedCache).to.be.an('function');
  });

  test('Test SharedCache buildKeyFromRequest() === buildKeyFromLambdaRuntime()', () => {
    let arn = 'arn:aws:lambda:us-west-2:9283468276298:function:test_backend';

    let sharedCache = new SharedCache(abstractDriver);

    let requestCacheKey = sharedCache.buildKeyFromRequest({
      isLambda: true,
      payload: {id1: 'blabla', id3: 'uhuhu', arr: [3, 6, 9], o2: {hey: 's', hey5: 'm'}},
      action: {
        source: {
          original: arn,
        },
      },
    });

    let runtimeCacheKey = sharedCache.buildKeyFromLambdaRuntime({
      context: {
        has: () => true,
        getOption: () => arn,
      },
      request: {
        data: {id1: 'blabla', o2: {hey5: 'm', hey: 's'}, id3: 'uhuhu', arr: [3, 9, 6]},
      },
    });

    chai.expect(requestCacheKey).to.equal(runtimeCacheKey);
  });
});

{'fraction_non_alphanumeric': 0.17464377055169894, 'fraction_numerical': 0.020460358056265986, 'mean_word_length': 3.394863563402889, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '7136380', 'n_tokens_mistral': 943, 'n_tokens_neox': 890, 'n_words': 192}