コード例 #1
0
 def test_whitelist_param_just_a_string(self):
     with self.assert_initialization_fails():
         NameWhitelistProcessor('foobar')
コード例 #2
0
 def test_whitelist_param_is_none(self):
     with self.assert_initialization_fails():
         NameWhitelistProcessor(None)
コード例 #3
0
 def test_whitelist_param_not_iterable(self):
     with self.assert_initialization_fails():
         NameWhitelistProcessor(10)
コード例 #4
0
 def test_no_whitelist_param(self):
     with self.assert_initialization_fails():
         NameWhitelistProcessor()
コード例 #5
0
 def test_empty_whitelist(self):
     whitelist = NameWhitelistProcessor(whitelist=[])
     with self.assertRaises(EventEmissionExit):
         whitelist({'name': sentinel.not_allowed_event})
コード例 #6
0
 def test_allowed_event(self):
     whitelist = NameWhitelistProcessor(whitelist=[sentinel.allowed_event])
     self.assert_event_passed_through(whitelist,
                                      {'name': sentinel.allowed_event})
コード例 #7
0
 def test_filtering_out(self):
     whitelist = NameWhitelistProcessor(whitelist=[sentinel.allowed_event])
     with self.assertRaises(EventEmissionExit):
         whitelist({'name': sentinel.not_allowed_event})