<commit_before>package redis.clients.jedis.tests;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

import java.util.List;

import org.junit.Test;

import redis.clients.jedis.Module;
import redis.clients.jedis.commands.ProtocolCommand;
import redis.clients.jedis.tests.commands.JedisCommandTestBase;
import redis.clients.util.SafeEncoder;

public class ModuleTest extends JedisCommandTestBase {

  static enum ModuleCommand implements ProtocolCommand {
    SIMPLE("testmodule.simple")  ;

    private final byte[] raw;

    ModuleCommand(String alt) {
      raw = SafeEncoder.encode(alt);
    }

    @Override
    public byte[] getRaw() {
      return SafeEncoder.encode("testmodule.simple");
    }
  }

  @Test
  public void testModules() {
    String res = jedis.moduleLoad("/tmp/testmodule.so");
    assertEquals(res, "OK");

    List<Module> modules = jedis.moduleList();

    assertEquals(modules.get(0).getName(), "testmodule");

    jedis.getClient().sendCommand(ModuleCommand.SIMPLE);
    Long out = jedis.getClient().getIntegerReply();
    assertTrue(out > 0);

    res = jedis.moduleUnload("testmodule");
    assertEquals(res, "OK");
  }

}<commit_msg>getRaw should return raw (#1697)<commit_after>package redis.clients.jedis.tests;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

import java.util.List;

import org.junit.Test;

import redis.clients.jedis.Module;
import redis.clients.jedis.commands.ProtocolCommand;
import redis.clients.jedis.tests.commands.JedisCommandTestBase;
import redis.clients.util.SafeEncoder;

public class ModuleTest extends JedisCommandTestBase {

  static enum ModuleCommand implements ProtocolCommand {
    SIMPLE("testmodule.simple")  ;

    private final byte[] raw;

    ModuleCommand(String alt) {
      raw = SafeEncoder.encode(alt);
    }

    @Override
    public byte[] getRaw() {
      return raw;
    }
  }

  @Test
  public void testModules() {
    String res = jedis.moduleLoad("/tmp/testmodule.so");
    assertEquals(res, "OK");

    List<Module> modules = jedis.moduleList();

    assertEquals(modules.get(0).getName(), "testmodule");

    jedis.getClient().sendCommand(ModuleCommand.SIMPLE);
    Long out = jedis.getClient().getIntegerReply();
    assertTrue(out > 0);

    res = jedis.moduleUnload("testmodule");
    assertEquals(res, "OK");
  }

}
{'fraction_non_alphanumeric': 0.12358609132802681, 'fraction_numerical': 0.0033514872224549644, 'mean_word_length': 4.113490364025696, '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': '4260682', 'n_tokens_mistral': 752, 'n_tokens_neox': 738, 'n_words': 142}