@@ -1320,6 +1320,29 @@ def test_get_and_set(self, r):
13201320 assert r .get ("integer" ) == str (integer ).encode ()
13211321 assert r .get ("unicode_string" ).decode ("utf-8" ) == unicode_string
13221322
1323+ def test_set_options_mutually_exclusive (self , r ):
1324+ with pytest .raises (exceptions .DataError ):
1325+ r .set ("test" , 1 , ex = 1 , px = 1 )
1326+
1327+ with pytest .raises (exceptions .DataError ):
1328+ r .set ("test2" , 2 , exat = 3 , pxat = 5 )
1329+
1330+ with pytest .raises (exceptions .DataError ):
1331+ r .set ("test3" , 3 , ex = 5 , exat = 1 )
1332+
1333+ def test_set_options_type_check (self , r ):
1334+ with pytest .raises (exceptions .DataError ):
1335+ r .set ("test" , 1 , ex = "hi" )
1336+
1337+ with pytest .raises (exceptions .DataError ):
1338+ r .set ("test1" , 3 , px = object ())
1339+
1340+ with pytest .raises (exceptions .DataError ):
1341+ r .set ("test2" , 2 , exat = 5.1 )
1342+
1343+ with pytest .raises (exceptions .DataError ):
1344+ r .set ("test3" , 1 , pxat = 3j )
1345+
13231346 @skip_if_server_version_lt ("6.2.0" )
13241347 def test_getdel (self , r ):
13251348 assert r .getdel ("a" ) is None
0 commit comments