コード例 #1
0
def say_hello() -> None:
    config = load_config()
    greeter = Greeter(languages=list(config.languages),
                      greetings=list(config.greetings))
    sentence = greeter.greet("world")
    print(green(sentence))
コード例 #2
0
def test_greeter() -> None:
    greeter = Greeter(translations={"hello": {"es": "hola"}})
    assert greeter.greet("test") == "Hola, test!"
コード例 #3
0
def handler(event, context):
    config = load_config()
    greeter = Greeter(languages=config.languages, greetings=config.greetings)
    print(greeter.greet("world"))
コード例 #4
0
def say_hello() -> None:
    greeting = Greeter().greet("Pantsbuild")
    print(green(greeting))
コード例 #5
0
def test_greeter() -> None:
    greeter = Greeter(languages=["es"], greetings=["good morning"])
    assert greeter.greet("world") == "Buenos días, world!"
コード例 #6
0
ファイル: main.py プロジェクト: TomFern/pants-example-test
def say_hello() -> None:
    config = load_config()
    greeter = Greeter(languages=list(config.languages),
                      greetings=list(config.greetings))
    sentence = greeter.greet("world")
    print(green(string_concat(sentence, ', nice to meet you')))