예제 #1
0
 def test_search_process11(self):
     """
     Test in the Court of Justice of São Paulo that the process does not exist
     """
     response = {"number": "1000000-00.0000.8.26.0000", "state": "sp"}
     self.assertEqual("Nao foi possivel executar essa operacao.",
                      search_process(json.dumps(response)))
예제 #2
0
 def do_POST(self):
     """
     POST in API
     Example: 
     {    
         "number": "1002298-86.2015.8.26.0271",
         "state" : "sp"
     }
     """
     try:
         content_length = int(self.headers['Content-Length'])
         body = self.rfile.read(content_length)
         self.send_response(200)
         self.end_headers()
         response = BytesIO()
         body = json.dumps(esaj.search_process(body.decode()))
         response.write(str(body).encode())
         self.wfile.write(response.getvalue())
     except:
         print ("Error in request")
예제 #3
0
 def test_search_process10(self):
     """
     Test in the Court of Justice of Mato Grosso do Sul
     """
     response = {"number": "0001092-83.2009.8.12.0035", "state": "ms"}
     self.assertEqual(2, len(search_process(json.dumps(response))))
예제 #4
0
 def test_search_process08(self):
     """
     Test in the Court of Justice of Mato Grosso do Sul 
     """
     response = {"number": "0000083-75.2011.8.12.0016", "state": "ms"}
     self.assertEqual(2, len(search_process(json.dumps(response))))
예제 #5
0
 def test_search_process07(self):
     """
     Test in the Court of Justice of São Paulo where there is only one process
     """
     response = {"number": "0010599-28.2019.8.26.0100", "state": "sp"}
     self.assertEqual(1, len(search_process(json.dumps(response))))
예제 #6
0
 def test_search_process04(self):
     """
     Test in the Court of Justice of São Paulo in which the process is in secrecy of justice
     """
     response = {"number": "0015338-39.2012.8.26.0278", "state": "sp"}
     self.assertEqual("Caso Privado", search_process(json.dumps(response)))
예제 #7
0
 def test_search_process02(self):
     """
     Test in the Court of Justice of Mato Grosso do Sul where there is only one process
     """
     response = {"number": "0821901-51.2018.8.12.0001", "state": "ms"}
     self.assertEqual(1, len(search_process(json.dumps(response))))
예제 #8
0
 def test_search_process01(self):
     """
     Test at the Court of Justice of São Paulo where you have a lawsuit in 1st and 2nd degree
     """
     response = {"number": "1002298-86.2015.8.26.0271", "state": "sp"}
     self.assertEqual(3, len(search_process(json.dumps(response))))