class Greetings(object): def __init__(self, the_greeter): self.the_greeter = the_greeter def __call__(self, *args, **kwargs): return '{} World'.format(self.the_greeter.__name__) @Greetings def Hello(): pass # Hello()
def hello_world():return "Hello World"- class Greetings(object):
- def __init__(self, the_greeter):
- self.the_greeter = the_greeter
- def __call__(self, *args, **kwargs):
- return '{} World'.format(self.the_greeter.__name__)
- @Greetings
- def Hello():
- pass
- # Hello()
import codewars_test as test # TODO Write tests import solution # or from solution import example # test.assert_equals(actual, expected, [optional] message) @test.describe("Fixed Tests") def basic_tests(): @test.it('Basic Test Cases') def basic_test_cases(): test.assert_equals(Hello(), 'Hello World')
- import codewars_test as test
- # TODO Write tests
- import solution # or from solution import example
- # test.assert_equals(actual, expected, [optional] message)
- @test.describe("Fixed Tests")
- def basic_tests():
- @test.it('Basic Test Cases')
- def basic_test_cases():
test.assert_equals(hello_world(), 'Hello World')- test.assert_equals(Hello(), 'Hello World')