def test_phantom_backend(self): """ verify that the phantom_backend closure requires that the phantom_path and js_path files exist """ # non-existent phantomjs path with self.assertRaises(ValueError): phantom_backend('fake_path.exe', self.js_path) # non-existent js path with self.assertRaises(ValueError): phantom_backend(self.phantom_path, 'fake_path.js') # both paths exist try: phantom_backend(self.phantom_path, self.js_path) except ValueError: self.fail('phantom_backend raises ValueError')
def test_get_empty(self, mock_get): get = phantom_backend(self.phantom_path, self.js_path) text = get("http://www.empty-example.com") self.assertIsNone(text)