<commit_before>import craftai from '../src';

import CONFIGURATION_1 from './data/configuration_1.json';

describe('client.sharedAgentInspectorUrl(<agentId>, <timestamp>)', function() {
  let client;
  const agentId = 'get_public_url_' + RUN_ID;

  before(function() {
    client = craftai(CRAFT_CFG);
    expect(client).to.be.ok;
    return client.deleteAgent(agentId)
      .then(() => client.createAgent(CONFIGURATION_1, agentId));
  });

  it('should return a shared inspector url', function() {
    const timestamp = 1234567890987;
    return client.sharedAgentInspectorUrl(agentId, timestamp)
      .then(publicInspectorUrl => {
        expect(publicInspectorUrl).to.not.be.equal('');
        const splittedPublicInspectorUrl = publicInspectorUrl.split('?');
        expect(splittedPublicInspectorUrl.length).to.be.equal(2);
        expect(splittedPublicInspectorUrl[1]).to.be.equal(`t=${timestamp}`);
        return client.getAgentInspectorUrl(agentId, timestamp)<commit_msg>delete agent in shareable tests<commit_after>import craftai from '../src';

import CONFIGURATION_1 from './data/configuration_1.json';

describe('client.sharedAgentInspectorUrl(<agentId>, <timestamp>)', function() {
  let client;
  const agentId = 'get_public_url_' + RUN_ID;

  before(function() {
    client = craftai(CRAFT_CFG);
    expect(client).to.be.ok;
    return client.deleteAgent(agentId)
      .then(() => client.createAgent(CONFIGURATION_1, agentId));
  });

  after(function() {
    client.deleteAgent(agentId);
  });

  it('should return a shared inspector url', function() {
    const timestamp = 1234567890987;
    return client.sharedAgentInspectorUrl(agentId, timestamp)
      .then(publicInspectorUrl => {
        expect(publicInspectorUrl).to.not.be.equal('');
        const splittedPublicInspectorUrl = publicInspectorUrl.split('?');
        expect(splittedPublicInspectorUrl.length).to.be.equal(2);
        expect(splittedPublicInspectorUrl[1]).to.be.equal(`t=${timestamp}`);
        return client.getAgentInspectorUrl(agentId, timestamp)
{'fraction_non_alphanumeric': 0.13754282917278512, 'fraction_numerical': 0.01762114537444934, 'mean_word_length': 4.53929539295393, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, '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': '2871581', 'n_tokens_mistral': 647, 'n_tokens_neox': 614, 'n_words': 103}