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