<commit_before>require 'test_helper'

class MachineTest < ActiveSupport::TestCase
  should "be valid" do
    assert Machine.new.valid?
  end

  context "#ip" do
    setup do
      @machine = Factory(:machine)
    end

    should "return sousreseau and quatr_octet" do
      assert_equal "192.168.0.10", @machine.ip
    end

    should "update correctly" do
      @machine.ip = "192.168.0.11"
      assert_equal "192.168.0.11", @machine.ip
    end

    should "not update if IP is invalid" do<commit_msg>Fixed broken test with Machine.new<commit_after>require 'test_helper'

class MachineTest < ActiveSupport::TestCase
  should "be valid" do
    assert ! Machine.new.valid?
    assert Machine.new(:nom => "my-server").valid?
  end

  context "#ip" do
    setup do
      @machine = Factory(:machine)
    end

    should "return sousreseau and quatr_octet" do
      assert_equal "192.168.0.10", @machine.ip
    end

    should "update correctly" do
      @machine.ip = "192.168.0.11"
      assert_equal "192.168.0.11", @machine.ip
    end

    should "not update if IP is invalid" do
{'fraction_non_alphanumeric': 0.10648148148148148, 'fraction_numerical': 0.05, 'mean_word_length': 2.8607142857142858, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 6, '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': '6507949', 'n_tokens_mistral': 384, 'n_tokens_neox': 347, 'n_words': 102}