def test_bad_deny_list_type(self): with self.assertRaises(TypeError): _construct_composite_allow_list(mock_branch["branch_id"].copy(), None, "108")
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)
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)
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)
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)))
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))