Esempio n. 1
0
def test_tv_show_actor_property():
    tv_show1 = TV_Show("Sailor Moon: Crystal", 2014)
    actor1 = Actor("Anika Noni Rose")
    actor2 = Actor("Keith David")
    tv_show1.actors = actor1
    tv_show1.actors = actor2
    assert tv_show1.actors == [actor1, actor2]
Esempio n. 2
0
def test_tv_show_genre_property():
    tv_show1 = TV_Show("Sailor Moon: Crystal", 2014)
    genre1 = Genre("Animation")
    genre2 = Genre("Action")
    tv_show1.genres = genre1
    tv_show1.genres = genre2
    assert tv_show1.genres == [genre1, genre2]
Esempio n. 3
0
def test_tv_show_init():
    tv_show1 = TV_Show("Sailor Moon: Crystal", 2014)
    assert repr(tv_show1) == "<TV Show Sailor Moon: Crystal, 2014>"
    tv_show2 = TV_Show("", 0)
    assert tv_show2.tv_show_name is None
    tv_show3 = TV_Show(42, "")
    assert tv_show3.tv_show_name is None
Esempio n. 4
0
def test_tv_show_replace_director_property():
    tv_show1 = TV_Show("Sailor Moon: Crystal", 2014)
    director1 = Director("John Musker")
    director2 = Director("Ron Clements")
    tv_show1.director = director1
    tv_show1.director = director2
    assert tv_show1.director is director2
Esempio n. 5
0
def test_user_time_spent_watching_tv_shows_property():
    tv_show1 = TV_Show("Sailor Moon: Crystal", 2014)
    tv_show1.number_of_episode = 30
    tv_show1.runtime_minutes = 23
    user1 = User("Jenna da Cruz", "testing123")
    user1.watch_tv_show(tv_show1)
    assert user1.time_spent_watching_tv_shows_minutes is 690
Esempio n. 6
0
def test_tv_show_remove_genre():
    tv_show1 = TV_Show("Sailor Moon: Crystal", 2014)
    genre1 = Genre("Animation")
    genre2 = Genre("Action")
    tv_show1.add_genre(genre1)
    tv_show1.add_genre(genre2)
    tv_show1.remove_genre(genre1)
    assert tv_show1.return_genre() == [genre2]
Esempio n. 7
0
def test_tv_show_remove_actor():
    tv_show1 = TV_Show("Sailor Moon: Crystal", 2014)
    actor1 = Actor("Kotono Mitsuishi")
    actor2 = Actor("Amanda Celine Miller")
    tv_show1.add_actor(actor1)
    tv_show1.add_actor(actor2)
    tv_show1.remove_actor(actor1)
    assert tv_show1.return_actor() == [actor2]
Esempio n. 8
0
def test_tv_show_review_3_false_eq_function():
    tv_show1 = TV_Show("Sailor Moon: Crystal", 2014)
    review1 = TV_Show_Review(tv_show1, "I really liked it", 9)
    review2 = TV_Show_Review(tv_show1, "I really liked it", 8)
    assert review1.__eq__(review2) is False
Esempio n. 9
0
def test_tv_show_eq_function():
    tv_show1 = TV_Show("Sailor Moon: Crystal", 2014)
    tv_show2 = TV_Show("Sailor Moon: Crystal", 2014)
    assert tv_show1.__eq__(tv_show2) is True
Esempio n. 10
0
def test_user_tv_show_add_review():
    tv_show1 = TV_Show("Sailor Moon: Crystal", 2014)
    review1 = TV_Show_Review(tv_show1, "I really liked it", 9)
    user1 = User("Jenna da Cruz", "testing123")
    user1.add_tv_review(review1)
    assert user1.tv_show_reviews == [review1]
Esempio n. 11
0
def test_tv_show_fail_runtime_property():
    tv_show1 = TV_Show("Sailor Moon: Crystal", 2014)
    tv_show1.number_of_episode = 30
    with pytest.raises(ValueError):
        tv_show1.runtime_minutes = -2
    assert tv_show1.runtime_minutes is None
Esempio n. 12
0
def test_tv_show_runtime_property():
    tv_show1 = TV_Show("Sailor Moon: Crystal", 2014)
    tv_show1.number_of_episode = 30
    tv_show1.runtime_minutes = 23
    assert tv_show1.runtime_minutes == 690
Esempio n. 13
0
def test_tv_show_add_actor():
    tv_show1 = TV_Show("Sailor Moon: Crystal", 2014)
    actor1 = Actor("Kotono Mitsuishi")
    tv_show1.add_actor(actor1)
    assert tv_show1.return_actor() == [actor1]
Esempio n. 14
0
def test_tv_show_false_lt_function():
    tv_show1 = TV_Show("Sailor Moon: Crystal", 2014)
    tv_show2 = TV_Show("Lost", 2004)
    assert tv_show1.__lt__(tv_show2) is False
Esempio n. 15
0
def test_tv_show_false_eq_function():
    tv_show1 = TV_Show("Sailor Moon: Crystal", 2014)
    tv_show2 = Movie(" ", 11)
    assert tv_show1.__eq__(tv_show2) is False
Esempio n. 16
0
def test_tv_show_review_rating_property():
    tv_show1 = TV_Show("Sailor Moon: Crystal", 2014)
    review1 = TV_Show_Review(tv_show1, "I really liked it", 9)
    assert review1.rating is 9
Esempio n. 17
0
def test_tv_show_review_timestamp_property():
    tv_show1 = TV_Show("Sailor Moon: Crystal", 2014)
    review1 = TV_Show_Review(tv_show1, "I really liked it", 9)
    assert review1.timestamp == datetime.time
Esempio n. 18
0
def test_tv_show_title_property():
    tv_show1 = TV_Show("Sailor Moon: Crystal", 2014)
    tv_show1.title = " Sailor Moon "
    assert tv_show1.title == "Sailor Moon"
Esempio n. 19
0
def test_user_watched_tv_shows_property():
    tv_show1 = TV_Show("Sailor Moon: Crystal", 2014)
    user1 = User("Jenna da Cruz", "testing123")
    user1.watch_tv_show(tv_show1)
    assert user1.watched_tv_shows == [tv_show1]
Esempio n. 20
0
def test_tv_show_description_property():
    tv_show1 = TV_Show("Sailor Moon: Crystal", 2014)
    tv_show1.description = "     Crime fighting sailor guardians out to protect the legendary silver crystal. "
    assert tv_show1.description == "Crime fighting sailor guardians out to protect the legendary silver crystal."
Esempio n. 21
0
def test_user_tv_show_review_property():
    tv_show1 = TV_Show("Sailor Moon: Crystal", 2014)
    user1 = User("Jenna da Cruz", "testing123")
    review1 = TV_Show_Review(tv_show1, "I loved it", 10)
    user1.add_tv_review(review1)
    assert user1.tv_show_reviews == [review1]
Esempio n. 22
0
def test_tv_show_director_property():
    tv_show1 = TV_Show("Sailor Moon: Crystal", 2014)
    director1 = Director("Munehisa Sakai")
    tv_show1.director = director1
    assert tv_show1.director is director1