"""
This test show main features required for our api service

"""

import movie_service
import unittest


class OverviewTestCase(unittest.TestCase):
    def setUp(self):
        movie_service._clear_movies()

    def test_create(self):
        movie = movie_service.create(name="Base movie", sample_attr=0)

        assert movie

    def test_update(self):
        initial_value = None
        value_to_set = 1

        movie = movie_service.create(name="Base movie", sample_attr=initial_value)

        base_value = movie.sample_attr

        movie_service.update(name="Base movie", set_sample_attr=value_to_set)

    @unittest.expectedFailure
    def test_delete(self):
        raise NotImplementedError("Implement me")
        movie_name = f"Base movie {random.randint(0, 10_000)}"
        movie = movie_service.create(name=movie_name, sample_attr=initial_value)

        assert movie_services.find_movie(by_name=movie_name)
        move_service.delete(name=movie_name)
        assert movie_services.find_movie(by_name=movie_name) == None

    @unittest.expectedFailure
    def test_get(self):
        raise NotImplementedError("Implement me")
        movie_name = f"Base movie {random.randint(0, 10_000)}"
        assert movie_services.get_movie(by_name=movie_name) == None
        movie = movie_service.create(name=movie_name, sample_attr=initial_value)

        assert movie_services.get_movie(by_name=movie_name)
