Ejemplo n.º 1
0
 def test_should_be_empty_if_whitelist_file_doesnot_exist(self, mock_open):
     mock_open.side_effect = IOError
     self.assertEqual("", get_whitelist())
Ejemplo n.º 2
0
 def test_should_be_empty_if_whitelist_file_doesnot_exist(self, mock_open):
     mock_open.side_effect = IOError
     self.assertEqual("", get_whitelist())
Ejemplo n.º 3
0
 def test_load_whitelist_from_file(self, mock_open):
     mock_open.return_value.__enter__.return_value.read.return_value = "foo"
     self.assertEqual("foo", get_whitelist())
     mock_open.assert_called_with('whitelizard.txt', mode='r')
Ejemplo n.º 4
0
 def test_load_whitelist_from_file(self, mock_open):
     mock_open.return_value.__enter__.return_value.read.return_value = "foo"
     self.assertEqual("foo", get_whitelist())
     mock_open.assert_called_with('whitelizard.txt', mode='r')