Skip to content

Commit

Permalink
Upgrade black code formatter to veresion 21.5b1
Browse files Browse the repository at this point in the history
  • Loading branch information
seratch committed May 28, 2021
1 parent 35e2246 commit 97a5250
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 26 deletions.
4 changes: 3 additions & 1 deletion integration_tests/audit_logs/test_async_client.py
Expand Up @@ -10,7 +10,9 @@

class TestAuditLogsClient(unittest.TestCase):
def setUp(self):
self.client = AsyncAuditLogsClient(token=os.environ[SLACK_SDK_TEST_GRID_ORG_ADMIN_USER_TOKEN])
self.client = AsyncAuditLogsClient(
token=os.environ[SLACK_SDK_TEST_GRID_ORG_ADMIN_USER_TOKEN]
)

def tearDown(self):
pass
Expand Down
4 changes: 3 additions & 1 deletion integration_tests/audit_logs/test_client.py
Expand Up @@ -9,7 +9,9 @@

class TestAuditLogsClient(unittest.TestCase):
def setUp(self):
self.client = AuditLogsClient(token=os.environ[SLACK_SDK_TEST_GRID_ORG_ADMIN_USER_TOKEN])
self.client = AuditLogsClient(
token=os.environ[SLACK_SDK_TEST_GRID_ORG_ADMIN_USER_TOKEN]
)

def tearDown(self):
pass
Expand Down
4 changes: 3 additions & 1 deletion integration_tests/samples/scim/search_groups_async.py
Expand Up @@ -8,9 +8,11 @@

client = AsyncSCIMClient(token=os.environ["SLACK_SDK_TEST_GRID_ORG_ADMIN_USER_TOKEN"])


async def main():
response = await client.search_groups(start_index=1, count=2)
print("-----------------------")
print(response.groups)

asyncio.run(main())

asyncio.run(main())
34 changes: 20 additions & 14 deletions integration_tests/scim/test_scim_client_write.py
Expand Up @@ -52,25 +52,31 @@ def test_user_crud(self):

# Patch using dict
# snake_cased keys will be automatically converted to camelCase
patch_result_2 = self.client.patch_user(id=creation.user.id, partial_user={
"user_name": f"user_{now}_3",
"name": {
"given_name": "Kaz",
"family_name": "Sera",
}
})
patch_result_2 = self.client.patch_user(
id=creation.user.id,
partial_user={
"user_name": f"user_{now}_3",
"name": {
"given_name": "Kaz",
"family_name": "Sera",
},
},
)
self.assertEqual(patch_result_2.status_code, 200)
self.assertEqual(patch_result_2.user.user_name, f"user_{now}_3")
self.assertEqual(patch_result_2.user.name.given_name, "Kaz")

# using camelCase also works
patch_result_3 = self.client.patch_user(id=creation.user.id, partial_user={
"userName": f"user_{now}_4",
"name": {
"givenName": "Kazuhiro",
"familyName": "Sera",
}
})
patch_result_3 = self.client.patch_user(
id=creation.user.id,
partial_user={
"userName": f"user_{now}_4",
"name": {
"givenName": "Kazuhiro",
"familyName": "Sera",
},
},
)
self.assertEqual(patch_result_3.status_code, 200)
self.assertEqual(patch_result_3.user.user_name, f"user_{now}_4")
self.assertEqual(patch_result_3.user.name.given_name, "Kazuhiro")
Expand Down
8 changes: 4 additions & 4 deletions integration_tests/web/test_admin_barriers.py
Expand Up @@ -39,15 +39,15 @@ def test_sync(self):
creation = client.admin_barriers_create(
primary_usergroup_id=self.idp_usergroup_id1,
barriered_from_usergroup_ids=[self.idp_usergroup_id2],
restricted_subjects=["call", "im", "mpim"]
restricted_subjects=["call", "im", "mpim"],
)
self.assertIsNotNone(creation)

modification = client.admin_barriers_update(
barrier_id=creation["barrier"]["id"],
primary_usergroup_id=self.idp_usergroup_id2,
barriered_from_usergroup_ids=[self.idp_usergroup_id1],
restricted_subjects=["call", "im", "mpim"]
restricted_subjects=["call", "im", "mpim"],
)
self.assertIsNotNone(modification)

Expand All @@ -64,14 +64,14 @@ async def test_async(self):
creation = await client.admin_barriers_create(
primary_usergroup_id=self.idp_usergroup_id1,
barriered_from_usergroup_ids=[self.idp_usergroup_id2],
restricted_subjects=["call", "im", "mpim"]
restricted_subjects=["call", "im", "mpim"],
)
self.assertIsNotNone(creation)

modification = await client.admin_barriers_update(
barrier_id=creation["barrier"]["id"],
primary_usergroup_id=self.idp_usergroup_id2,
barriered_from_usergroup_ids=[self.idp_usergroup_id1],
restricted_subjects=["call", "im", "mpim"]
restricted_subjects=["call", "im", "mpim"],
)
self.assertIsNotNone(modification)
Expand Up @@ -38,7 +38,12 @@ def setUp(self):
exclude_archived=True, limit=100, types="private_channel"
)
self.channel_id = next(
(c["id"] for c in convs["channels"] if c["name"] != "general" and not c["is_ext_shared"]), None
(
c["id"]
for c in convs["channels"]
if c["name"] != "general" and not c["is_ext_shared"]
),
None,
)
if self.channel_id is None:
millis = int(round(time.time() * 1000))
Expand Down
2 changes: 1 addition & 1 deletion scripts/run_validation.sh
Expand Up @@ -3,7 +3,7 @@

script_dir=`dirname $0`
cd ${script_dir}/..
pip install "black==20.8b1"
pip install "black==21.5b1"
black slack_sdk/ slack/ tests/ && \
python setup.py codegen && \
python setup.py validate
4 changes: 2 additions & 2 deletions setup.py
Expand Up @@ -23,12 +23,12 @@
"pytest-cov>=2,<3",
"codecov>=2,<3",
"flake8>=3,<4",
"black==20.8b1",
"black==21.5b1",
"psutil>=5,<6",
"databases>=0.3",
]
codegen_dependencies = [
"black==20.8b1",
"black==21.5b1",
]

needs_pytest = {"pytest", "test", "ptr"}.intersection(sys.argv)
Expand Down
2 changes: 1 addition & 1 deletion tests/helpers.py
Expand Up @@ -42,4 +42,4 @@ def get_mock_server_mode() -> str:


def is_ci_unstable_test_skip_enabled() -> bool:
return os.environ.get("CI_UNSTABLE_TESTS_SKIP_ENABLED") == "1"
return os.environ.get("CI_UNSTABLE_TESTS_SKIP_ENABLED") == "1"

0 comments on commit 97a5250

Please sign in to comment.