<commit_before># frozen_string_literal: true
require_relative 'test_base'

class FeatureContainerPropertiesTest < TestBase

  def self.id58_prefix
    '3A8'
  end

  # - - - - - - - - - - - - - - - - - - - - - - - - - -

  test 'D91', %w(
  requires bash, won't run in sh ) do
    any_image_without_bash = 'alpine:latest'
    run_cyber_dojo_sh(image_name:any_image_without_bash)
    assert stdout.empty?, pretty_result(:stdout)
    assert stderr.empty?, pretty_result(:stderr)
    assert_equal 'faulty', colour, pretty_result(:colour)
    assert logged?('TrafficLight.colour'), pretty_result(:log)
    # TODO: Needs work: problem is that after
    #  result = docker_run_cyber_dojo_sh(id, image_name, max_seconds, tgz_in)
    # result[:status] is not being looked at
  end

  # - - - - - - - - - - - - - - - - - - - - - - - - - -
<commit_msg>Add todo note re looking result of capture3_with_timeout()<commit_after># frozen_string_literal: true
require_relative 'test_base'

class FeatureContainerPropertiesTest < TestBase

  def self.id58_prefix
    '3A8'
  end

  # - - - - - - - - - - - - - - - - - - - - - - - - - -

  test 'D91', %w(
  requires bash, won't run in sh ) do
    any_image_without_bash = 'alpine:latest'
    run_cyber_dojo_sh(image_name:any_image_without_bash)
    assert stdout.empty?, pretty_result(:stdout)
    assert stderr.empty?, pretty_result(:stderr)
    assert_equal 'faulty', colour, pretty_result(:colour)
    assert logged?('TrafficLight.colour'), pretty_result(:log)
    # TODO: Needs work: problem is that after
    #  result = docker_run_cyber_dojo_sh(id, image_name, max_seconds, tgz_in)
    # result[:status] is not being looked at
    # It appears this is the only test where it is not true that
    #   result[:timeout] || result[:status] === 0
  end

  # - - - - - - - - - - - - - - - - - - - - - - - - - -

{'fraction_non_alphanumeric': 0.14154013015184383, 'fraction_numerical': 0.007592190889370932, 'mean_word_length': 2.6462450592885376, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 16, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7143403', 'n_tokens_mistral': 674, 'n_tokens_neox': 642, 'n_words': 137}