<commit_before>require 'helper'

class TestRedisSelection < MiniTest::Unit::TestCase
  describe 'with real redis' do
    before do
      Sidekiq.redis = REDIS_1
      Sidekiq.redis {|c| c.flushdb }
    end

    describe "should correctly identify different redis connections" do 
	  
      before do
          setup_two_redis_conns
      end

      it 'should know there are two redis connections' do
        assert SidekiqMultiRedisClient::Config.redi.size, 2
      end

      it 'should set the first redis instance as the current one' do
        assert SidekiqMultiRedisClient::Config.current_redis, REDIS_CONNECTION_POOLS[0]
      end<commit_msg>allow for testing where there is no real redis connection<commit_after>require 'helper'

class TestRedisSelection < MiniTest::Unit::TestCase
  describe 'with real redis' do
    before do
      Sidekiq.redis = REDIS_1
      Sidekiq.redis {|c| c.flushdb rescue nil }
    end

    describe "should correctly identify different redis connections" do 
	  
      before do
          setup_two_redis_conns
      end

      it 'should know there are two redis connections' do
        assert SidekiqMultiRedisClient::Config.redi.size, 2
      end

      it 'should set the first redis instance as the current one' do
        assert SidekiqMultiRedisClient::Config.current_redis, REDIS_CONNECTION_POOLS[0]
      end
{'fraction_non_alphanumeric': 0.05461254612546126, 'fraction_numerical': 0.004428044280442804, 'mean_word_length': 2.988235294117647, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5818586', 'n_tokens_mistral': 413, 'n_tokens_neox': 396, 'n_words': 128}