コード例 #1
0
ファイル: method_views.py プロジェクト: ygyangguang/pyjs
 def echo(self):
     # Assume the JSON params field is a list of length at least one
     rv = echo(self.method, self.params[0])
     if (isinstance(rv, dict)):
         self.json_response["error"] = rv
     elif (rv):
         self.json_response["result"] = rv
コード例 #2
0
ファイル: method_views.py プロジェクト: brodybits/pyjs
 def echo(self):
     # Assume the JSON params field is a list of length at least one
     rv = echo(self.method, self.params[0])
     if(isinstance(rv, dict)):
         self.json_response["error"] = rv
     elif(rv):
         self.json_response["result"] = rv
コード例 #3
0
ファイル: celery_tasks.py プロジェクト: ygyangguang/pyjs
def celery_echo(mth, txt):
    return echo(mth,txt)
コード例 #4
0
ファイル: tests.py プロジェクト: michaeltoback/hello-django
 def test_echo_happy_path(self):
     result = views.echo("John")
     self.assertTrue("Hello John! The time is " in result) 
     self.assertEquals(len(result), 51)