Example #1
0
 def test_bad_deny_list_type(self):
     with self.assertRaises(TypeError):
         _construct_composite_allow_list(mock_branch["branch_id"].copy(),
                                         None, "108")
Example #2
0
 def test_bad_deny_list_value(self):
     deny_list = list(range(108, 110))
     with self.assertRaises(ValueError):
         _construct_composite_allow_list(mock_branch["branch_id"].copy(),
                                         None, deny_list)
Example #3
0
 def test_bad_allow_list_entry_type(self):
     allow_list = [str(i) for i in range(101, 105)]
     with self.assertRaises(ValueError):
         _construct_composite_allow_list(mock_branch["branch_id"].copy(),
                                         allow_list, None)
Example #4
0
 def test_allow_list_and_deny_list_failure(self):
     allow_list = list(range(101, 105))
     deny_list = list(range(105, 109))
     with self.assertRaises(ValueError):
         _construct_composite_allow_list(mock_branch["branch_id"].copy(),
                                         allow_list, deny_list)
Example #5
0
 def test_good_deny_list(self):
     deny_list = list(range(101, 105))
     composite_allow_list = _construct_composite_allow_list(
         mock_branch["branch_id"].copy(), None, deny_list)
     self.assertEqual(composite_allow_list, set(range(105, 109)))
Example #6
0
 def test_none_none(self):
     branch_list = mock_branch["branch_id"].copy()
     composite_allow_list = _construct_composite_allow_list(
         mock_branch["branch_id"].copy(), None, None)
     self.assertEqual(composite_allow_list, set(branch_list))