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