예제 #1
0
def test_no_repeated_words():
    string = 'Nice to meet you.'
    assert repeated_word(string) == None
예제 #2
0
def test_more_than_one_repeated_word():
    string = 'Once upon a time, there was a brave princess in a time...'
    assert repeated_word(string) == 'a'
예제 #3
0
def test_long_string():
    string = 'It was the best of times, it was the worst of times, it was the age of wisdom, it was the age of foolishness, it was the epoch of belief, it was the epoch of incredulity, it was the season of Light, it was the season of Darkness, it was the spring of hope, it was the winter of despair, we had everything before us, we had nothing before us, we were all going direct to Heaven, we were all going direct the other way – in short, the period was so far like the present period, that some of its noisiest authorities insisted on its being received, for good or for evil, in the superlative degree of comparison only...'
    assert repeated_word(string) == 'it'
예제 #4
0
def test_punctuation_marks():
    string = 'It was a queer, sultry summer, the summer they electrocuted the Rosenbergs, and I didn’t know what I was doing in New York...'
    assert repeated_word(string) == 'summer'
예제 #5
0
def test_capital_words():
    string = 'Good morning, it feels good to see you again'
    assert repeated_word(string) == 'good'
def test_normal_string():
    x = "Once upon a time, there was a brave princess who..."
    actual = repeated_word(x)
    expected = 'a'
    assert expected == actual
def test_string_with_commas():
    x = "It was a queer, sultry summer, the summer they electrocuted the Rosenbergs, and I didn’t know what I was doing in New York..."
    actual = repeated_word(x)
    expected = 'summer'
    assert expected == actual
def test_no_repetaetd_word():
    x = "nothing is repeated"
    actual = repeated_word(x)
    expected = None
    assert expected == actual
예제 #9
0
def test_no_repeats():
    string = "The rain in spain falls mainly on a plain."
    expected = repeated_word(string)
    assert expected == 'there is no repeated word in your input!'
예제 #10
0
def test_simple_string():
    string = "Once upon a time, there was a brave princess who.."
    expected = repeated_word(string)
    assert expected == 'a'
예제 #11
0
def test_punctuation():
    string = "It was a queer, sultry summer, the summer they electrocuted the Rosenbergs, and I didn’t know what I was doing in New York..."
    expected = repeated_word(string)
    assert expected == 'summer'
예제 #12
0
def test_capitalization():
    string = "Cat dog cat dog."
    expected = repeated_word(string)
    assert expected == 'cat'