Exemple #1
0
def test_dequeue_second():
    shelter = AnimalShelter()
    shelter.enqueue(Cat())
    shelter.enqueue(Dog())
    actual = shelter.dequeue('dog')
    assert actual == 'dog'
Exemple #2
0
def test_dequeue_no_pref():
    shelter = AnimalShelter()
    shelter.enqueue(Cat())
    shelter.enqueue(Dog())
    actual = shelter.dequeue()
    assert actual == 'enter cat or dog'
Exemple #3
0
def test_dequeue_first():
    shelter = AnimalShelter()
    shelter.enqueue(Cat())
    shelter.enqueue(Dog())
    actual = shelter.dequeue('cat')
    assert actual == 'cat'
Exemple #4
0
def test_not_cat_or_dog():
    shelter = AnimalShelter()
    actual = shelter.enqueue(Cat())
    assert actual == None
Exemple #5
0
def test_add_two():
    shelter = AnimalShelter()
    shelter.enqueue(Cat())
    shelter.enqueue(Dog())
    assert shelter.head.next.value == 'dog'
Exemple #6
0
def test_add_one():
    shelter = AnimalShelter()
    shelter.enqueue(Cat())
    assert shelter.head.value == 'cat'
Exemple #7
0
def test_create_shelter():
    shelter = AnimalShelter()
    assert type(shelter) == AnimalShelter