示例#1
0
def send_warnings(team: str):
    logging.info("Sending warning! Results: \n{}".format(
        client.get_answer(team, show_all=True)))
    user_list = slack_client.api_call("users.list")[
        "members"]  # use this to get users.
    for email in cfg["teams"][team]["users_to_notify"]:
        user = [
            user for user in user_list
            if user["profile"].get("email", "") == email
        ][0]  # use this to get id
        user_channel = slack_client.api_call(
            "im.open",
            user=user["id"])["channel"]["id"]  # use this to get dm channel

        send_reminder(user_channel, team)
示例#2
0
def stop_estimations(team: str):
    logging.info("Estimation finished! Results: \n{}".format(
        client.get_answer(team, show_all=True)))
    user_list = slack_client.api_call("users.list")[
        "members"]  # use this to get users.
    for email in cfg["teams"][team]["users_to_notify"]:
        user = [
            user for user in user_list
            if user["profile"].get("email", "") == email
        ][0]  # use this to get id
        user_channel = slack_client.api_call(
            "im.open",
            user=user["id"])["channel"]["id"]  # use this to get dm channel

        end_conversation(user_channel, team)
    start_meeting(team)
示例#3
0
	def test_400_ans(self):
		"""Тест создания корректного ответа 400"""
		self.assertEqual(get_answer({RESPONSE: 400, ERROR: 'Bad Request'}), '400 : Bad Request')
示例#4
0
	def test_200_ans(self):
		"""Тест создания корректного ответа 200"""
		self.assertEqual(get_answer({RESPONSE: 200}), '200 : OK')
示例#5
0
 def test_without_response(self):
     with self.assertRaises(ValueError):
         get_answer({})
示例#6
0
 def test_answer_400(self):
     self.assertEqual(get_answer({
         RESPONSE: 400,
         ERROR: 'Bad Request'
     }), '400 : Bad Request')
示例#7
0
 def test_answer_200(self):
     self.assertEqual(get_answer({RESPONSE: 200}), '200 : OK')