docstr: In a clustered redis, the script keys must be in the same slot.
  
  This test should fail, because the two keys we send are in different
  slots. This test assumes that {foo} and {bar} will not go to the same
  server when used. In a setup with 3 primaries and 3 secondaries, this
  assumption holds.
docstr_tok: ["In","a","clustered","redis",",","the","script","keys","must","be","in","the","same","slot",".","This","test","should","fail",",","because","the","two","keys","we","send","are","in","different","slots",".","This","test","assumes","that","{","foo","}","and","{","bar","}","will","not","go","to","the","same","server","when","used",".","In","a","setup","with","3","primaries","and","3","secondaries",",","this","assumption","holds","."]
code: def test_eval_crossslot(self, r):
      """
      In a clustered redis, the script keys must be in the same slot.
  
      This test should fail, because the two keys we send are in different
      slots. This test assumes that {foo} and {bar} will not go to the same
      server when used. In a setup with 3 primaries and 3 secondaries, this
      assumption holds.
      """
      r.set("A{foo}", 2)
      r.set("B{bar}", 4)
      # 2 * 4 == 8
  
      script = """
          local value = redis.call('GET', KEYS[1])
          local value2 = redis.call('GET', KEYS[2])
          return value * value2
          """
      with pytest.raises(exceptions.RedisClusterException):
          r.eval(script, 2, "A{foo}", "B{bar}")
  
imports: import pytest
  import redis
  from redis import exceptions
  from redis.commands.core import Script
  from tests.conftest import skip_if_redis_enterprise, skip_if_server_version_lt
label_desc: Use image node_id 6 for calling the TestScripting obj's underlying member method code with example usage: obj.test_eval_crossslot(r) without return types