Ejemplo n.º 1
0
 def test_hello(self):
     self.assertEqual(hello_world.hello(), 'Hello, World!')
Ejemplo n.º 2
0
 def test_hello_with_name(self):
     self.assertEqual(
         'Hello, Jane!',
         hello_world.hello('Jane')
     )
Ejemplo n.º 3
0
    def test_hello(self):
        value = hello()

        self.assertEqual(value, 'Hello!!!')
Ejemplo n.º 4
0
 def test_hello_with_other_sample_name(self):
     self.assertEqual("Hello, Bob!", hello_world.hello("Bob"))
Ejemplo n.º 5
0
 def test_hello_with_blank_name(self):
     self.assertEqual(
         'Hello, World!',
         hello_world.hello('')
     )
Ejemplo n.º 6
0
def test_say_hello():
    assert hello() == "Hello, World!"
Ejemplo n.º 7
0
 def test_hello_with_umlaut_name(self):
     self.assertEqual('Hello, Jürgen!', hello_world.hello('Jürgen'))
Ejemplo n.º 8
0
 def test_say_hello(self):
     expected = 'Hello World!'
     self.assertEqual(hello(), expected)
Ejemplo n.º 9
0
#!/usr/bin/env python3

import hello_world

hello_world.test()
a = hello_world.add(1, 2)
print(a)

hello_world.hello(3)
Ejemplo n.º 10
0
def test_hello_without_name():
    assert 'Hello, World!' == hello_world.hello()
Ejemplo n.º 11
0
 def test_hello(self):
     """Test to assert hello_world function return expected result"""
     self.assertEqual(hello_world.hello(), 'Hello, World!')
Ejemplo n.º 12
0
def test_hello_with_none_name():
    assert 'Hello, World!' == hello_world.hello(None)
Ejemplo n.º 13
0
def test_hello_with_blank_name():
    assert 'Hello, World!' == hello_world.hello('')
Ejemplo n.º 14
0
 def test_hello_with_umlaut_name(self):
     self.assertEqual("Hello, Jürgen!", hello_world.hello("Jürgen"))
Ejemplo n.º 15
0
 def test_hello_with_sample_name(self):
     self.assertEqual(
         'Hello, Alice!',
         hello_world.hello('Alice')
     )
print(result.stderr.decode("utf-8"))

# Let's make a listing of the file's content.

# In[ ]:

with open(pyfile, 'r') as f:
    print(f.read())

# Let's import the file as a Python module and use the embedded functions. If the name of the file is fixed and known, then the usual Python `import` statement will do the job.

# In[ ]:

import hello_world
help(hello_world)
hello_world.hello()

# If the name of the python file is given as the value of a Python string variable then the standard library `importlib` may be used. Note the need to strip any suffix from a file name.

# In[ ]:

import importlib
mymodule = importlib.import_module(pyfile.rstrip(".py"))
help(mymodule)
mymodule.hello()

# For platforms where the shell escape `!` might fail, an alternative is to use the standard Python `subprocess` library.

# ## Method 2. Cloning a git repository
#
# Downloading a collection of files from a git repository with `wget` (or `curl`) can be cumbersome, particularly if the names of the individual files are unknown or subject to change. And, unfortunately, Github does not provide an API for accessing a folder of files.
Ejemplo n.º 17
0
 def test_hello_with_umlaut_name(self):
     self.assertEqual(
         'Hello, Jürgen!',
         hello_world.hello('Jürgen')
     )
Ejemplo n.º 18
0
def app():
    print("This is my app")
    hello()
    print(sum("Over", "Watch"))
Ejemplo n.º 19
0
 def test_hello_with_sample_name(self):
     self.assertEqual('Hello, Alice!', hello_world.hello('Alice'))
Ejemplo n.º 20
0
def app():
    print("This is my app")
    hello_world.hello()
    print(hello_world.sum("Over", "Watch"))
Ejemplo n.º 21
0
 def test_hello_with_none_name(self):
     self.assertEqual('Hello, World!', hello_world.hello(None))
Ejemplo n.º 22
0
 def test_hellojanine(self):
     self.assertEqual(hello_world.hello("Janine"), 'Hello, Janine!')
def test_answer():
    assert hello() == "hello world"
Ejemplo n.º 24
0
 def test_hello_no_name(self):
     self.assertEqual( # nice multi line situation you got here
         'Hello, World!', # expected behavior
         hello_world.hello() # hello_world.py module, hello() func w no args
     )
Ejemplo n.º 25
0
 def test_hello_with_none_name(self):
     self.assertEqual(
         'Hello, World!',
         hello_world.hello(None)
     )
Ejemplo n.º 26
0
 def test_hello_name_given(self):
     self.assertEqual(
         'Hello, Ol Eleven Bearings!', # will use whatever we put in for the test!
         hello_world.hello('Ol Eleven Bearings')
     )
Ejemplo n.º 27
0
    def test_hello_unicode(self):
        self.assertEqual('Ʉ', hello_world.hello('u'))

        self.assertEqual('wərd', hello_world.hello('word'))
Ejemplo n.º 28
0
 def test_hello_utf_brayka(self):
     self.assertEqual(
         'Hello, Evgénya!',
         hello_world.hello('Evgénya')
     )
Ejemplo n.º 29
0
 def test_hello(self):
     self.assertEqual(hello_world.hello(), 'Hello, World!')
Ejemplo n.º 30
0
 def test_hello_o_thor(self):
     self.assertEqual(
         'Hello, BOBZOR!',
         hello_world.hello('BOBZOR')
     )
Ejemplo n.º 31
0
 def test_say_hi(self):
     self.assertEqual(hello(), "Hello, World!")
Ejemplo n.º 32
0
import hello_world

ret = hello_world.hello('tester')
print ret
Ejemplo n.º 33
0
 def test_hello_with_other_sample_name(self):
     self.assertEqual(
         'Hello, Bob!',
         hello_world.hello('Bob')
     )
Ejemplo n.º 34
0
# -*- coding: utf-8 -*-

from __future__ import unicode_literals
import unittest

import hello_world


class HelloWorldTests(unittest.TestCase):
    def test_hello_without_name(self):
        self.assertEqual('Hello, World!', hello_world.hello())

    def test_hello_with_sample_name(self):
        self.assertEqual('Hello, Alice!', hello_world.hello('Alice'))

    def test_hello_with_other_sample_name(self):
        self.assertEqual('Hello, Bob!', hello_world.hello('Bob'))

    def test_hello_with_umlaut_name(self):
        self.assertEqual('Hello, Jürgen!', hello_world.hello('Jürgen'))


if __name__ == '__main__':
    hello_world.hello('Bob')
    unittest.main()
Ejemplo n.º 35
0
 def test_hello_without_name(self):
     self.assertEqual(
         'Hello, World!',
         hello_world.hello()
     )
Ejemplo n.º 36
0
def test_2():
    assert student.hello('NUAMES', 14) == 'Hello World!\nNUAMES\nPeriod 14'
Ejemplo n.º 37
0
 def test_greeting_message(self):
     self.assertEqual(hello_world.hello(), 'Hello, World!')
Ejemplo n.º 38
0
def test_1():
    assert student.hello('Mr. Simonsen',
                         1) == 'Hello World!\nMr. Simonsen\nPeriod 1'
Ejemplo n.º 39
0
 def test_hello_with_other_sample_name(self):
     self.assertEqual('Hello, Bob!', hello_world.hello('Bob'))
Ejemplo n.º 40
0
import unittest

from hello_world import hello

# Tests adapted from `problem-specifications//canonical-data.json` @ v1.1.0

hello()

#class HelloWorldTest(unittest.TestCase):
#    def test_say_hi(self):
#        self.assertEqual(hello(), "Hello, World!")

#if __name__ == "__main__":
#    unittest.main()
Ejemplo n.º 41
0
 def test_hello_with_blank_name(self):
     self.assertEqual('Hello, World!', hello_world.hello(''))
def test_hello_world():
    assert isinstance(hello(), str)
Ejemplo n.º 43
0
 def test_hello_without_name(self):
     self.assertEqual('Hello, World!', hello_world.hello())
Ejemplo n.º 44
0
 def test_hello_with_sample_name(self):
     self.assertEqual("Hello, Alice!", hello_world.hello("Alice"))