Ejemplo n.º 1
0
def make_movie():
    movie = Movie("WOW", 2020)
    movie.rank = 1001
    movie.description = "This is the best movie in the world."
    movie.director = Director("Barraza")
    movie.runtime_minutes = 100
    movie.rating = 100
    movie.votes = 100
    movie.revenue = 100
    movie.metascore = 100
    return movie
Ejemplo n.º 2
0
def dict_to_movie(dict):
    movie = Movie(dict.title, dict.release_year)
    movie.rank = dict.rank
    movie.description = dict.description
    movie.director = dict_to_director(dict.director)
    movie.actors = dict_to_actors(dict.actors)
    movie.genres = dict_to_genres(dict.genres)
    movie.runtime_minutes = dict.runtime_minutes
    movie.rating = dict.rating
    movie.votes = dict.votes
    movie.revenue = dict.revenue
    movie.metascore = dict.metascore
    return movie
def test_repo_can_add_movie(session_factory):
    repo = SqlAlchemyRepository(session_factory)

    number_of_movies = repo.get_number_of_movies()

    new_movie_id = number_of_movies + 1

    movie = Movie("WOW", 2020)
    movie.rank = new_movie_id
    movie.description = "This is the best movie in the world."
    movie.director = Director("Barraza")
    movie.runtime_minutes = 100
    movie.rating = 100
    movie.votes = 100
    movie.revenue = 100
    movie.metascore = 100
    repo.add_movie(movie)

    assert repo.get_movie(new_movie_id) == movie
Ejemplo n.º 4
0
def test_description():
    m1 = Movie("wow", 0)
    m1.description = ""
    assert (m1.description == "")