def do(self): try: #call exe (write file)a #subprocess category.exe ret = callprocess.callhoge(self._exepath,self._inputfile,self._outputfile) #open file defined categorized urls #sample http://domain.com,"news" ret = self._getCategorizedUrls() return ret except Exception as e: self._mylog.error("inputfile:" + self._inputfile + " outputfile:" + self._outputfile) raise Exception(e.args)
def do(self): try: #call exe (write file)a #subprocess category.exe ret = callprocess.callhoge(self._exepath, self._inputfile, self._outputfile) #open file defined categorized urls #sample http://domain.com,"news" ret = self._getCategorizedUrls() return ret except Exception as e: self._mylog.error("inputfile:" + self._inputfile + " outputfile:" + self._outputfile) raise Exception(e.args)
def test_success(self): ret = callprocess.callhoge("ls") self.assertEqual(ret,0)
def test_err_lack_of_args(self): with self.assertRaises(Exception): callprocess.callhoge("ls -al","b")
def test_err_processname_not_exists(self): with self.assertRaises(Exception): callprocess.callhoge("a","a","b")