<commit_before>require File.dirname(__FILE__) + '/../test_helper'

class OrthomclGroupTest < ActiveSupport::TestCase
  def test_all_overlapping_groups_single_return
    groups = OrthomclGroup.all_overlapping_groups(['cel','dme'])
    assert_equal 1, groups.length, groups.inspect
    assert_equal 1, groups[0].id
    assert_kind_of OrthomclGroup, groups[0]
  end
  
  def test_all_overlapping_groups_multiple_return
    # I had stupid problems with this, so there's some extra stuff to test fixtures were loaded correctly
    assert OrthomclGene.first(:conditions => "orthomcl_name like 'dme%' and id=5" )
    assert OrthomclGene.count >= 7
    assert OrthomclGene.find_by_orthomcl_name('dme|dmoe13aa')
    
    # real tests
    groups = OrthomclGroup.all_overlapping_groups(['dme'])
    assert_equal 2, groups.length, groups.inspect
    assert_equal [1,2].sort, groups.pick(:id).sort
    assert_kind_of OrthomclGroup, groups[0]
  end
  
  def test_empty_all_overlapping
    stupid = OrthomclGroup.all_overlapping_groups([])
    assert_equal OrthomclRun.official_run_v2.orthomcl_groups.count, stupid.length, stupid
  end
  
  def test_single_group_with_multiple_same_species_members
    groups = OrthomclGroup.all_overlapping_groups(['two'])
    assert_equal 1, groups.length, groups
    assert_equal 4, groups[0].id, groups
  end
  
  def test_single_members_by_codes
    assert OrthomclGroup.find(4).single_members_by_codes(['one'])
    assert_equal false, OrthomclGroup.find(4).single_members_by_codes(['two'])
    assert_equal false, OrthomclGroup.find(4).single_members_by_codes(['nup'])
  end
end<commit_msg>extra test required no bug fix<commit_after>require File.dirname(__FILE__) + '/../test_helper'

class OrthomclGroupTest < ActiveSupport::TestCase
  def test_all_overlapping_groups_single_return
    groups = OrthomclGroup.all_overlapping_groups(['cel','dme'])
    assert_equal 1, groups.length, groups.inspect
    assert_equal 1, groups[0].id
    assert_kind_of OrthomclGroup, groups[0]
  end
  
  def test_all_overlapping_groups_multiple_return
    # I had stupid problems with this, so there's some extra stuff to test fixtures were loaded correctly
    assert OrthomclGene.first(:conditions => "orthomcl_name like 'dme%' and id=5" )
    assert OrthomclGene.count >= 7
    assert OrthomclGene.find_by_orthomcl_name('dme|dmoe13aa')
    
    # real tests
    groups = OrthomclGroup.all_overlapping_groups(['dme'])
    assert_equal 2, groups.length, groups.inspect
    assert_equal [1,2].sort, groups.pick(:id).sort
    assert_kind_of OrthomclGroup, groups[0]
  end
  
  def test_empty_all_overlapping
    stupid = OrthomclGroup.all_overlapping_groups([])
    assert_equal OrthomclRun.official_run_v2.orthomcl_groups.count, stupid.length, stupid
  end
  
  def test_single_group_with_multiple_same_species_members
    groups = OrthomclGroup.all_overlapping_groups(['two'])
    assert_equal 1, groups.length, groups
    assert_equal 4, groups[0].id, groups
  end
  
  def test_single_members_by_codes
    assert OrthomclGroup.find(4).single_members_by_codes(['one'])
    assert_equal false, OrthomclGroup.find(4).single_members_by_codes(['two'])
    assert_equal false, OrthomclGroup.find(4).single_members_by_codes(['nup'])
    
    assert OrthomclGroup.find(1).single_members_by_codes(['pfa','ath'])
    assert_equal false,  OrthomclGroup.find(1).single_members_by_codes(['pfa','ath','nup'])
  end
end
{'fraction_non_alphanumeric': 0.09548916227299356, 'fraction_numerical': 0.011716461628588167, 'mean_word_length': 5.10912343470483, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '2469495', 'n_tokens_mistral': 1160, 'n_tokens_neox': 1134, 'n_words': 211}