示例#1
0
import os
import sys

# add package .zip to python lookup path
__dir__ = os.path.dirname(__file__)
path = os.path.join(__dir__, 'funniest')
sys.path.insert(0, path)

import funniest
print funniest.joke()
print "I am not funny"

import argparse
parser = argparse.ArgumentParser()
parser.add_argument("echo", help="echo the string you use here")
args = parser.parse_args()
print args.echo
示例#2
0
 def test_joke(self):
     got_joke = joke()
     self.assertTrue(isinstance(got_joke, basestring))
示例#3
0
 def test_is_nonempty(self):
     s = funniest.joke()
     self.assertTrue(len(s) > 0)
示例#4
0
	def test_is_string(self):
		s = funniest.joke()
		self.assertTrue(isinstance(s, str))
示例#5
0
 def test_is_string(self):
     s = funniest.joke()
     self.assertTrue(isinstance(s, str))
示例#6
0
 def do_GET(self):
     print self.path
     self.wfile.write('HTTP/1.1 200 Okay\r\n\r\n' + funniest.joke())
示例#7
0
import funniest
print(funniest.joke())

import pkgutil
greeting = pkgutil.get_data("funniest", 'data/greeting.txt')
print(greeting)

示例#8
0
 def test_is_nonempty(self):
     s = funniest.joke()
     self.assertTrue(len(s) > 0)
示例#9
0
 def do_GET(self):
     print self.path
     self.wfile.write('HTTP/1.1 200 Okay\r\n\r\n'+funniest.joke())
示例#10
0
def main():
    if len(sys.argv) == 1:
        funniest.joke()
    else:
        output = ' '.join(sys.argv[1:])
        print output
示例#11
0
def main():
    print funniest.joke()
def main():
    print funniest.joke()
示例#13
0
def spout_wisdom():
    print "There's a heaven for a G."
    print joke()
示例#14
0
 def do_GET(self):
     print(self.path)
     self.wfile.write(('HTTP/1.1 200 Okay\r\n\r\n'+funniest.joke()).encode(encoding='utf_8'))
示例#15
0
def test_b():
    import funniest
    assert funniest.joke(
    ) == "ek haathi tha, ek chiti thi" + "ek din chiti ne kaha" + "haahaa"