Exemple #1
0
#!/usr/bin/env python

import helloworld
helloworld.hello("World")
helloworld.hello2("World")
Exemple #2
0
def test_hello():
    assert helloworld.hello() == 'Hello, World!'
Exemple #3
0
 def test_hello(self):
     self.assertEqual( helloworld.hello(1), "Hello")
Exemple #4
0

#数组参数
def deduplication(self, nums):  #找出排序数组的索引

    for i in range(len(nums)):
        if nums[i] == self:
            return i
    i = 0
    for x in nums:
        if self > x:
            i += 1
    return i


helloworld.hello('iechenyb 999')
helloworld.print_func('iechenyb')
cal = calendar.month(2016, 1)
print("以下输出2016年1月份的日历:")
print(cal)

# 格式化成2016-03-20 11:45:39形式
print(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()))

# 格式化成Sat Mar 28 22:24:24 2016形式
print(time.strftime("%a %b %d %H:%M:%S %Y", time.localtime()))

# 将格式字符串转换为时间戳
a = "Sat Mar 28 22:24:24 2016"
print(time.mktime(time.strptime(a, "%a %b %d %H:%M:%S %Y")))
import helloworld

x = raw_input('Hit enter')
if x == '':
    helloworld.hello()
Exemple #6
0
# coding=utf8

from helloworld import hello

hw = hello()
hw.printHello()

print('hello world')
Exemple #7
0
#import the helloworld function
#from helloworld import hello
import helloworld

#call funtion
helloworld.hello()


Exemple #8
0
 def test_empty_arg(self):
     self.assertEqual(helloworld.hello(''), 'Hello World!')
Exemple #9
0
def hello(request, lang="en"):
    cad = helloworld.hello(lang)
#    cad = helloworld.hello()
    return render_to_response('hello.html', locals())
Exemple #10
0
 def test_largename249(self):
     name = 'a'*249
     with self.assertRaises(helloworld.Error):
         helloworld.hello(name)
Exemple #11
0
 def test_no_args(self):
     self.assertEqual(helloworld.hello(), 'Hello World!')
Exemple #12
0
 def test_largename248(self):
     name = 'a'*248
     self.assertEqual(helloworld.hello(name), 'Hello {}!'.format(name))
Exemple #13
0
 def test_args(self):
     names = ['John', 'Jane', 'Jeff' 'J', '\n', '\t']
     for name in names:
         self.assertEqual(
             helloworld.hello(name), 'Hello {}!'.format(name))
 def test_hello(self):
     self.assertEqual(helloworld.hello(), 'Hello, World!')
def test_HelloWorld(capsys):
    hello()
    printed = capsys.readouterr()
    assert printed.out == "Hello World!\n"
def test_hello():
    assert hello() == "Hello World!"
Exemple #17
0
 def test_hello(self):
     self.assertEqual("Hello World.", hello())
 def test_hello_world(self):
     result = hello()
     self.assertEqual(result, 'hello')
Exemple #19
0
#!/usr/bin/env python3

import helloworld

print(helloworld.hello());
print(helloworld.heyman(5, "StarNight"));
print(helloworld.add(5, 6));
help(helloworld);
Exemple #20
0
#!/usr/bin/env python

import helloworld, sys

greeter = sys.argv[1]
helloworld.hello(greeter)
helloworld.hello2(greeter)
Exemple #21
0
 def test_hello(self):
     self.assertEqual(hello(), 'hello im chirchir')
     
Exemple #22
0
 def test1():
     helloworld.hello("Tom")