Ejemplo n.º 1
0
    def test_list_ParamA_DoesNotCallAnyListMethod(self, client):
        cmd = ShowTrackerCmd(client)
        list_args = "a"

        cmd.do_list(list_args)

        assert not client.list_tvshows.called and not client.list_tvshows.called
Ejemplo n.º 2
0
    def test_rm_String1Space_CallsAddShowWithInt1(self, client):
        cmd = ShowTrackerCmd(client)
        rm_args = "1 "

        cmd.do_rm(rm_args)

        client.remove_tvshow.assert_called_once_with(1)
Ejemplo n.º 3
0
    def test_rm_String1SpaceS_DoesNotCallAddShow(self, client):
        cmd = ShowTrackerCmd(client)
        rm_args = "1 S"

        cmd.do_rm(rm_args)

        assert not client.remove_tvshow.called
Ejemplo n.º 4
0
    def test_add_String1Space_CallsAddShowWithInt1(self, client):
        cmd = ShowTrackerCmd(client)
        add_args = "1 "

        cmd.do_add(add_args)

        client.add_tvshow.assert_called_once_with(1)
Ejemplo n.º 5
0
    def test_add_String1SpaceS_DoesNotCallAddShow(self, client):
        cmd = ShowTrackerCmd(client)
        add_args = "1 S"

        cmd.do_add(add_args)

        assert not client.add_tvshow.called
Ejemplo n.º 6
0
    def test_list_ParamMinusEDownloadingSpaceA_DoesNotCallAnyListMethod(self, client):
        cmd = ShowTrackerCmd(client)
        list_args = "-e downloading a"

        cmd.do_list(list_args)

        assert not client.list_tvshows.called and not client.list_tvshows.called
Ejemplo n.º 7
0
    def test_list_ParamMinusMinusTvshows_CallsListTvshowsWithNoArgs(self, client):
        cmd = ShowTrackerCmd(client)
        list_args = "--tvshows"

        cmd.do_list(list_args)

        client.list_tvshows.assert_called_once_with()
Ejemplo n.º 8
0
    def test_list_ParamMinusEStored_CallsListEpisodesWithStored(self, client):
        cmd = ShowTrackerCmd(client)
        list_args = "-e stored"

        cmd.do_list(list_args)

        client.list_episodes.assert_called_once_with(EpisodeState.STORED)
Ejemplo n.º 9
0
    def test_list_ParamMinusEDownloaded_CallsListEpisodesWithDownloaded(self, client):
        cmd = ShowTrackerCmd(client)
        list_args = "-e downloaded"

        cmd.do_list(list_args)

        client.list_episodes.assert_called_once_with(EpisodeState.DOWNLOADED)
Ejemplo n.º 10
0
    def test_add_NoParameter_DoesNotCallAddShow(self, client):
        cmd = ShowTrackerCmd(client)
        add_args = ""

        cmd.do_add(add_args)

        assert not client.add_tvshow.called
Ejemplo n.º 11
0
    def test_list_ParamMinusESpaceMinusMinusEpisodes_DoesNotCallAnyListMethod(self, client):
        cmd = ShowTrackerCmd(client)
        list_args = "-e --episodes"

        cmd.do_list(list_args)

        assert not client.list_tvshows.called and not client.list_tvshows.called
Ejemplo n.º 12
0
    def test_list_ParamMinusE_CallsListEpisodesWithNoArgs(self, client):
        cmd = ShowTrackerCmd(client)
        list_args = "-e"

        cmd.do_list(list_args)

        client.list_episodes.assert_called_once_with(None)