コード例 #1
0
 def test_slack_channel_membership_multiple_2(self):
     # member of two of three channels
     channel_list = self.channel_list_eight
     membership = get_robot_channel_membership(channel_list)
     self.assertEqual(len(membership), 2)
     self.assertCountEqual(membership, {
         'C024BE91B': 'fun2',
         'C024BE91C': 'fun3'
     })
コード例 #2
0
 def test_slack_channel_membership_multiple_3(self):
     # member of three of three channels
     channel_list = self.channel_list_nine
     membership = get_robot_channel_membership(channel_list)
     self.assertEqual(len(membership), 3)
     self.assertCountEqual(
         membership,
         {'C024BE91B': 'fun2', 'C024BE91C': 'fun3', 'C024BE91A': 'fun1'}
     )
コード例 #3
0
 def test_slack_channel_membership_general(self):
     # general channel
     channel_list = self.channel_list_ten
     membership = get_robot_channel_membership(channel_list)
     self.assertEqual(len(membership), 1)
     self.assertCountEqual(
         membership,
         {'C024BE91B': 'fun2'}
     )
コード例 #4
0
 def test_slack_channel_membership_multiple_2(self):
     # member of two of three channels
     channel_list = self.channel_list_eight
     membership = get_robot_channel_membership(channel_list)
     self.assertEqual(len(membership), 2)
     self.assertCountEqual(
         membership,
         {'C024BE91B': 'fun2', 'C024BE91C': 'fun3'}
     )
コード例 #5
0
 def test_slack_channel_membership_multiple_3(self):
     # member of three of three channels
     channel_list = self.channel_list_nine
     membership = get_robot_channel_membership(channel_list)
     self.assertEqual(len(membership), 3)
     self.assertCountEqual(membership, {
         'C024BE91B': 'fun2',
         'C024BE91C': 'fun3',
         'C024BE91A': 'fun1'
     })
コード例 #6
0
 def test_slack_channel_membership_multiple_1(self):
     # member of one of three channels
     channel_list = self.channel_list_seven
     membership = get_robot_channel_membership(channel_list)
     self.assertEqual(len(membership), 1)
     self.assertCountEqual(membership, {'C024BE91B': 'fun2'})
コード例 #7
0
 def test_slack_channel_membership_multiple_0(self):
     # member of none of three channels
     channel_list = self.channel_list_six
     membership = get_robot_channel_membership(channel_list)
     self.assertEqual(len(membership), 0)
     self.assertCountEqual(membership, {})
コード例 #8
0
 def test_slack_channel_membership_error_2(self):
     # channel key not present in json file
     channel_list = self.channel_list_five
     with self.assertRaises(KeyError):
         get_robot_channel_membership(channel_list)
コード例 #9
0
 def test_slack_channel_membership_error_1(self):
     # malformed json
     channel_list = self.channel_list_four
     with self.assertRaises(ValueError):
         get_robot_channel_membership(channel_list)
コード例 #10
0
 def test_slack_channel_membership_none(self):
     channel_list = self.channel_list_three
     membership = get_robot_channel_membership(channel_list)
     self.assertEqual(len(membership), 0)
     self.assertCountEqual(membership, {})
コード例 #11
0
 def test_slack_channel_membership_none(self):
     channel_list = self.channel_list_three
     membership = get_robot_channel_membership(channel_list)
     self.assertEqual(len(membership), 0)
     self.assertCountEqual(membership, {})
コード例 #12
0
 def test_slack_channel_membership_multiple_1(self):
     # member of one of three channels
     channel_list = self.channel_list_seven
     membership = get_robot_channel_membership(channel_list)
     self.assertEqual(len(membership), 1)
     self.assertCountEqual(membership, {'C024BE91B': 'fun2'})
コード例 #13
0
 def test_slack_channel_membership_multiple_0(self):
     # member of none of three channels
     channel_list = self.channel_list_six
     membership = get_robot_channel_membership(channel_list)
     self.assertEqual(len(membership), 0)
     self.assertCountEqual(membership, {})
コード例 #14
0
 def test_slack_channel_membership_error_2(self):
     # channel key not present in json file
     channel_list = self.channel_list_five
     with self.assertRaises(KeyError):
         get_robot_channel_membership(channel_list)
コード例 #15
0
 def test_slack_channel_membership_error_1(self):
     # malformed json
     channel_list = self.channel_list_four
     with self.assertRaises(ValueError):
         get_robot_channel_membership(channel_list)
コード例 #16
0
 def test_slack_channel_membership_single(self):
     channel_list = self.channel_list_one
     membership = get_robot_channel_membership(channel_list)
     self.assertEqual(len(membership), 1)
     self.assertCountEqual(membership, {'C024BE91L': 'fun1'})
コード例 #17
0
 def test_slack_channel_membership_general(self):
     # general channel
     channel_list = self.channel_list_ten
     membership = get_robot_channel_membership(channel_list)
     self.assertEqual(len(membership), 1)
     self.assertCountEqual(membership, {'C024BE91B': 'fun2'})
コード例 #18
0
 def test_slack_channel_membership_single(self):
     channel_list = self.channel_list_one
     membership = get_robot_channel_membership(channel_list)
     self.assertEqual(len(membership), 1)
     self.assertCountEqual(membership, {'C024BE91L': 'fun1'})