示例#1
0
 def test002_files_raise_h_type_None(self):
     self.request.query.name = None
     with patch("frontend.api.controllers.search.process_error") as mock:
         api_search.files("whatever")
         self.assertTrue(mock.called)
         self.assertIsInstance(mock.call_args[0][0], ValueError)
         self.assertEqual(str(mock.call_args[0][0]), "Hash not supported")
示例#2
0
 def test001_files_raise_none_None(self):
     with patch("frontend.api.controllers.search.process_error") as mock:
         api_search.files("whatever")
         self.assertTrue(mock.called)
         self.assertIsInstance(mock.call_args[0][0], ValueError)
         self.assertEqual(str(mock.call_args[0][0]),
                          "Can't find using both name and hash")