コード例 #1
0
    def test_get_command_when_cmd_is_do_not_upload(self):
        argv = ['-n', 'rec']
        command = get_command(argv, self.config)

        assert_equal(RecordCommand, type(command))
        assert_equal(False, command.skip_confirmation)
        assert_equal(True, command.do_not_upload)
コード例 #2
0
ファイル: builder_test.py プロジェクト: PragTob/asciinema
    def test_get_command_when_cmd_is_rec(self):
        command = get_command(['rec'], self.config)

        assert_equal(RecordCommand, type(command))
        assert_equal(self.config.api_url, command.api_url)
        assert_equal(self.config.api_token, command.api_token)
        assert_equal(None, command.cmd)
        assert_equal(None, command.title)
        assert_equal(False, command.skip_confirmation)
コード例 #3
0
    def test_get_command_when_cmd_is_rec(self):
        command = get_command(['rec'], self.config)

        assert_equal(RecordCommand, type(command))
        assert_equal(self.config.api_url, command.api_url)
        assert_equal(self.config.api_token, command.api_token)
        assert_equal(None, command.cmd)
        assert_equal(None, command.title)
        assert_equal(False, command.skip_confirmation)
コード例 #4
0
ファイル: builder_test.py プロジェクト: PragTob/asciinema
    def test_get_command_when_cmd_is_rec_and_options_given(self):
        argv = ['-c', '/bin/bash -l', '-t', "O'HAI LOL", '-y', 'rec']
        command = get_command(argv, self.config)

        assert_equal(RecordCommand, type(command))
        assert_equal(self.config.api_url, command.api_url)
        assert_equal(self.config.api_token, command.api_token)
        assert_equal('/bin/bash -l', command.cmd)
        assert_equal("O'HAI LOL", command.title)
        assert_equal(True, command.skip_confirmation)
コード例 #5
0
    def test_get_command_when_cmd_is_rec_and_options_given(self):
        argv = ['-c', '/bin/bash -l', '-t', "O'HAI LOL", '-y', 'rec']
        command = get_command(argv, self.config)

        assert_equal(RecordCommand, type(command))
        assert_equal(self.config.api_url, command.api_url)
        assert_equal(self.config.api_token, command.api_token)
        assert_equal('/bin/bash -l', command.cmd)
        assert_equal("O'HAI LOL", command.title)
        assert_equal(True, command.skip_confirmation)
コード例 #6
0
    def test_get_command_when_cmd_is_auth(self):
        command = get_command(['auth'], self.config)

        assert_equal(AuthCommand, type(command))
        assert_equal(self.config.api_url, command.api_url)
        assert_equal(self.config.api_token, command.api_token)
コード例 #7
0
    def test_get_command_when_cmd_is_absent(self):
        command = get_command([], self.config)

        assert_equal(RecordCommand, type(command))
コード例 #8
0
ファイル: builder_test.py プロジェクト: PragTob/asciinema
    def test_get_command_when_too_many_cmds(self):
        command = get_command(['foo', 'bar'], self.config)

        assert_equal(ErrorCommand, type(command))
        assert_equal("Too many arguments", command.message)
コード例 #9
0
ファイル: builder_test.py プロジェクト: PragTob/asciinema
    def test_get_command_when_cmd_is_unknown(self):
        command = get_command(['foobar'], self.config)

        assert_equal(ErrorCommand, type(command))
        assert_equal("'foobar' is not an asciinema command", command.message)
コード例 #10
0
def main():
    get_command(sys.argv[1:], Config()).execute()
コード例 #11
0
    def test_get_command_when_cmd_is_unknown(self):
        command = get_command(['foobar'], self.config)

        assert_equal(ErrorCommand, type(command))
        assert_equal("'foobar' is not an asciinema command", command.message)
コード例 #12
0
ファイル: builder_test.py プロジェクト: PragTob/asciinema
    def test_get_command_when_cmd_is_auth(self):
        command = get_command(['auth'], self.config)

        assert_equal(AuthCommand, type(command))
        assert_equal(self.config.api_url, command.api_url)
        assert_equal(self.config.api_token, command.api_token)
コード例 #13
0
ファイル: builder_test.py プロジェクト: PragTob/asciinema
    def test_get_command_when_cmd_is_absent(self):
        command = get_command([], self.config)

        assert_equal(RecordCommand, type(command))
コード例 #14
0
    def test_get_command_when_options_include_help(self):
        command = get_command(['--help'], self.config)

        assert_equal(HelpCommand, type(command))
コード例 #15
0
ファイル: builder_test.py プロジェクト: PragTob/asciinema
    def test_get_command_when_options_include_help(self):
        command = get_command(['--help'], self.config)

        assert_equal(HelpCommand, type(command))
コード例 #16
0
    def test_get_command_when_options_include_version(self):
        command = get_command(['--version'], self.config)

        assert_equal(VersionCommand, type(command))
コード例 #17
0
ファイル: builder_test.py プロジェクト: PragTob/asciinema
    def test_get_command_when_options_include_version(self):
        command = get_command(['--version'], self.config)

        assert_equal(VersionCommand, type(command))
コード例 #18
0
    def test_get_command_when_too_many_cmds(self):
        command = get_command(['foo', 'bar'], self.config)

        assert_equal(ErrorCommand, type(command))
        assert_equal("Too many arguments", command.message)
コード例 #19
0
ファイル: allPythonContent.py プロジェクト: Mondego/pyreco
def main():
    get_command(sys.argv[1:], Config()).execute()