Example #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
Example #2
0
 def test_joke(self):
     got_joke = joke()
     self.assertTrue(isinstance(got_joke, basestring))
Example #3
0
 def test_is_nonempty(self):
     s = funniest.joke()
     self.assertTrue(len(s) > 0)
Example #4
0
	def test_is_string(self):
		s = funniest.joke()
		self.assertTrue(isinstance(s, str))
Example #5
0
 def test_is_string(self):
     s = funniest.joke()
     self.assertTrue(isinstance(s, str))
Example #6
0
 def do_GET(self):
     print self.path
     self.wfile.write('HTTP/1.1 200 Okay\r\n\r\n' + funniest.joke())
Example #7
0
import funniest
print(funniest.joke())

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

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