Exemplo n.º 1
0
def test_10():
    with pytest.raises(Exception):
        without_end(100)
Exemplo n.º 2
0
def test_11():
    with pytest.raises(Exception):
        without_end(120.2)
Exemplo n.º 3
0
def test_8():
    assert without_end('Chocolate!') == 'hocolate'
Exemplo n.º 4
0
def test_9():
    assert without_end('woohoo') == 'ooho'
Exemplo n.º 5
0
def test_5():
    assert without_end('ab') == ''
Exemplo n.º 6
0
def test_7():
    assert without_end('kitten') == 'itte'
Exemplo n.º 7
0
def test_4():
    assert without_end('code') == 'od'
Exemplo n.º 8
0
def test_3():
    assert without_end('coding') == 'odin'
Exemplo n.º 9
0
def test_2():
    assert without_end('java') == 'av'
Exemplo n.º 10
0
def test_1():
    assert without_end('Hello') == 'ell'
Exemplo n.º 11
0
#!/usr/bin/env python
"""
test code for String without its ends.

Adapted from the "coding bat" site: https://codingbat.com/python

Given a string, return a version without the first and last char,
so "Hello" yields "ell". The string length will be at least 2.


without_end('Hello') → 'ell'
without_end('java') → 'av'
without_end('coding') → 'odin'
"""

# you can change this import to test different versions
from string_no_end import without_end
import pytest
# from walnut_party import walnut_party2 as walnut_party
# from walnut_party import walnut_party3 as walnut_party


def test_1():
    assert without_end('Hello') == 'ell'


def test_2():
    assert without_end('java') == 'av'


def test_3():