コード例 #1
0
ファイル: test_sllist.py プロジェクト: samx7a/pythonhacks
def test_first():
    colors = SingleLinkedList()
    colors.push("Cadmium Red Light")
    assert colors.first() == "Cadmium Red Light"
    colors.push("Hansa Yellow")
    assert colors.first() == "Cadmium Red Light"
    colors.shift("Pthalo Green")
    assert colors.first() == "Pthalo Green"
コード例 #2
0
 def test_first(self):
     colors = SingleLinkedList()
     colors.push('Cadmium Red Light')
     assert colors.first() == 'Cadmium Red Light'
     colors.push('Hansa Yellow')
     assert colors.first() == 'Cadmium Red Light'
     colors.shift('Pthalo Green')
     assert colors.first() == 'Pthalo Green'
コード例 #3
0
def test_first():
    colors = SingleLinkedList()
    colors.push('red')
    assert colors.first() == 'red'

    colors.push('yellow')
    assert colors.first() == 'red'

    colors.push('blue')
    assert colors.first() == 'red'