2424import mock
2525import pytest
2626import requests
27- import six
2827
2928from conftest import mock_connection_params , MockResponse
3029
@@ -310,7 +309,7 @@ def test_large_group_assignment_split():
310309 :return:
311310 """
312311 group_prefix = "G"
313- add_groups = [group_prefix + six . text_type (n + 1 ) for n in range (0 , 15 )]
312+ add_groups = [group_prefix + str (n + 1 ) for n in range (0 , 15 )]
314313 user = UserAction (
id_type = IdentityTypes .
enterpriseID ,
email = "[email protected] " )
315314 user .add_to_groups (groups = add_groups , group_type = GroupTypes .usergroup )
316315 assert user .maybe_split_groups (10 ) is True
@@ -325,7 +324,7 @@ def test_large_group_assignment_split_recursive():
325324 :return:
326325 """
327326 group_prefix = "G"
328- add_groups = [group_prefix + six . text_type (n + 1 ) for n in range (0 , 100 )]
327+ add_groups = [group_prefix + str (n + 1 ) for n in range (0 , 100 )]
329328 user = UserAction (
id_type = IdentityTypes .
enterpriseID ,
email = "[email protected] " )
330329 user .add_to_groups (groups = add_groups , group_type = GroupTypes .usergroup )
331330 assert user .maybe_split_groups (10 ) is True
@@ -339,8 +338,8 @@ def test_large_group_mix_split():
339338 :return:
340339 """
341340 group_prefix = "G"
342- add_groups = [group_prefix + six . text_type (n + 1 ) for n in range (0 , 15 )]
343- remove_groups = [group_prefix + six . text_type (n + 1 ) for n in range (15 , 30 )]
341+ add_groups = [group_prefix + str (n + 1 ) for n in range (0 , 15 )]
342+ remove_groups = [group_prefix + str (n + 1 ) for n in range (15 , 30 )]
344343 user = UserAction (
id_type = IdentityTypes .
enterpriseID ,
email = "[email protected] " )
345344 user .add_to_groups (groups = add_groups , group_type = GroupTypes .usergroup ) \
346345 .remove_from_groups (groups = remove_groups , group_type = GroupTypes .usergroup )
@@ -364,7 +363,7 @@ def test_large_group_action_split():
364363 conn = Connection (** mock_connection_params )
365364
366365 group_prefix = "G"
367- add_groups = [group_prefix + six . text_type (n + 1 ) for n in range (0 , 150 )]
366+ add_groups = [group_prefix + str (n + 1 ) for n in range (0 , 150 )]
368367 user = UserAction (
id_type = IdentityTypes .
enterpriseID ,
email = "[email protected] " )
369368 user .add_to_groups (groups = add_groups , group_type = GroupTypes .usergroup )
370369 assert conn .execute_single (user , immediate = True ) == (0 , 2 , 2 )
@@ -382,7 +381,7 @@ def test_group_size_limit():
382381 conn = Connection (** params )
383382
384383 group_prefix = "G"
385- add_groups = [group_prefix + six . text_type (n + 1 ) for n in range (0 , 150 )]
384+ add_groups = [group_prefix + str (n + 1 ) for n in range (0 , 150 )]
386385 user = UserAction (
id_type = IdentityTypes .
enterpriseID ,
email = "[email protected] " )
387386 user .add_to_groups (groups = add_groups , group_type = GroupTypes .usergroup )
388387 assert conn .execute_single (user , immediate = True ) == (0 , 3 , 3 )
@@ -409,7 +408,7 @@ def test_split_add_user():
409408
410409def test_split_role_assignment ():
411410 group_prefix = "G"
412- add_groups = [group_prefix + six . text_type (n + 1 ) for n in range (0 , 25 )]
411+ add_groups = [group_prefix + str (n + 1 ) for n in range (0 , 25 )]
413412 user = UserAction (
id_type = IdentityTypes .
enterpriseID ,
email = "[email protected] " )
414413 user .add_role (groups = add_groups , role_type = RoleTypes .admin )
415414 assert user .maybe_split_groups (10 ) is True
@@ -422,7 +421,7 @@ def test_no_group_split():
422421 :return:
423422 """
424423 group_prefix = "G"
425- add_groups = [group_prefix + six . text_type (n + 1 ) for n in range (0 , 5 )]
424+ add_groups = [group_prefix + str (n + 1 ) for n in range (0 , 5 )]
426425 user = UserAction (
id_type = IdentityTypes .
enterpriseID ,
email = "[email protected] " )
427426 user .add_to_groups (groups = add_groups , group_type = GroupTypes .usergroup )
428427 assert user .maybe_split_groups (10 ) is False
@@ -436,8 +435,8 @@ def test_complex_group_split():
436435 :return:
437436 """
438437 group_prefix = "G"
439- add_groups = [group_prefix + six . text_type (n + 1 ) for n in range (0 , 150 )]
440- add_products = [group_prefix + six . text_type (n + 1 ) for n in range (0 , 26 )]
438+ add_groups = [group_prefix + str (n + 1 ) for n in range (0 , 150 )]
439+ add_products = [group_prefix + str (n + 1 ) for n in range (0 , 26 )]
441440 user = UserAction (
id_type = IdentityTypes .
enterpriseID ,
email = "[email protected] " )
442441 user .commands = [{
443442 "add" : {
@@ -457,7 +456,7 @@ def test_split_remove_all():
457456 :return:
458457 """
459458 group_prefix = "G"
460- add_groups = [group_prefix + six . text_type (n + 1 ) for n in range (0 , 11 )]
459+ add_groups = [group_prefix + str (n + 1 ) for n in range (0 , 11 )]
461460 user = UserAction (
id_type = IdentityTypes .
enterpriseID ,
email = "[email protected] " )
462461 user .remove_from_groups (all_groups = True )
463462 assert user .maybe_split_groups (1 ) is False
@@ -480,7 +479,7 @@ def test_split_remove_all():
480479
481480
482481def test_split_group_action ():
483- user_template = six . text_type ( "user.{}@example.com" )
482+ user_template = "user.{}@example.com"
484483 add_users = [user_template .format (n + 1 ) for n in range (0 , 25 )]
485484 group = UserGroupAction (group_name = "Test Group" )
486485 group .add_users (users = add_users )
0 commit comments