@@ -305,10 +305,7 @@ def test_post_bytearray_success():
305305 args , kwargs = td .http .urlopen .call_args
306306 assert args == ("POST" , "https://api.treasuredata.com/foo" )
307307 assert kwargs ["body" ] == bytes_or_stream
308- if urllib3 .util .IS_PYOPENSSL :
309- assert isinstance (kwargs ["body" ], memoryview )
310- else :
311- assert isinstance (kwargs ["body" ], bytearray )
308+ assert isinstance (kwargs ["body" ], bytearray )
312309 assert sorted (kwargs ["headers" ].keys ()) == [
313310 "authorization" ,
314311 "date" ,
@@ -404,10 +401,7 @@ def test_put_bytes_success():
404401 with td .put ("/foo" , bytes_or_stream , 12 ) as response :
405402 args , kwargs = td .http .urlopen .call_args
406403 assert args == ("PUT" , "https://api.treasuredata.com/foo" )
407- if urllib3 .util .IS_PYOPENSSL :
408- assert kwargs ["body" ] == b"request body"
409- else :
410- assert kwargs ["body" ] == array (str ("b" ), bytes_or_stream )
404+ assert kwargs ["body" ] == array (str ("b" ), bytes_or_stream )
411405 assert sorted (kwargs ["headers" ].keys ()) == [
412406 "authorization" ,
413407 "content-length" ,
@@ -431,10 +425,7 @@ def test_put_bytes_unicode_success():
431425 with td .put ("/hoge" , bytes_or_stream , 12 ) as response :
432426 args , kwargs = td .http .urlopen .call_args
433427 assert args == ("PUT" , "https://api.treasuredata.com/hoge" )
434- if urllib3 .util .IS_PYOPENSSL :
435- assert kwargs ["body" ] == "リクエストボディー" .encode ("utf-8" )
436- else :
437- assert kwargs ["body" ] == array (str ("b" ), bytes_or_stream )
428+ assert kwargs ["body" ] == array (str ("b" ), bytes_or_stream )
438429 assert sorted (kwargs ["headers" ].keys ()) == [
439430 "authorization" ,
440431 "content-length" ,
@@ -510,10 +501,7 @@ def test_put_file_without_fileno_success():
510501 with td .put ("/foo" , bytes_or_stream , 12 ) as response :
511502 args , kwargs = td .http .urlopen .call_args
512503 assert args == ("PUT" , "https://api.treasuredata.com/foo" )
513- if urllib3 .util .IS_PYOPENSSL :
514- assert kwargs ["body" ] == b"request body"
515- else :
516- assert kwargs ["body" ] == array (str ("b" ), bytes_or_stream .getvalue ())
504+ assert kwargs ["body" ] == array (str ("b" ), bytes_or_stream .getvalue ())
517505 assert sorted (kwargs ["headers" ].keys ()) == [
518506 "authorization" ,
519507 "content-length" ,
@@ -537,10 +525,7 @@ def test_put_file_without_fileno_unicode_success():
537525 with td .put ("/hoge" , bytes_or_stream , 12 ) as response :
538526 args , kwargs = td .http .urlopen .call_args
539527 assert args == ("PUT" , "https://api.treasuredata.com/hoge" )
540- if urllib3 .util .IS_PYOPENSSL :
541- assert kwargs ["body" ] == "リクエストボディー" .encode ("utf-8" )
542- else :
543- assert kwargs ["body" ] == array (str ("b" ), bytes_or_stream .getvalue ())
528+ assert kwargs ["body" ] == array (str ("b" ), bytes_or_stream .getvalue ())
544529 assert sorted (kwargs ["headers" ].keys ()) == [
545530 "authorization" ,
546531 "content-length" ,
0 commit comments