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

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

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