def test_version_command(self, capsys): cli.main(['version']) out, err = capsys.readouterr() assert out == '{}\n'.format(cli.VERSION)
def test_ls_command(self, ls_command): cli.main(['ls', 'foo']) assert ls_command.call_count == 1
def test_timestamps(self, basicConfig, loglevel): cli.main(['--timestamps', '--log-level', loglevel, 'version']) assert basicConfig.call_args[1]['format'].startswith('%(asctime)s: ')
def test_debug_loglevel(self, basicConfig): cli.main(['--log-level=DEBUG', 'version']) assert basicConfig.call_args[1]['format'].startswith( '%(levelname)s:%(module)s') assert basicConfig.call_args[1]['level'] == 'DEBUG'
def test_rm_command(self, rm_command): cli.main(['rm', 'foo']) assert rm_command.call_count == 1
def test_debug_loglevel(self, basicConfig): cli.main(["--log-level=DEBUG", "version"]) assert basicConfig.call_args[1]["format"].startswith("%(levelname)s:%(module)s") assert basicConfig.call_args[1]["level"] == "DEBUG"
def test_targets_command(self, TargetsCommand, command): cli.main([command]) assert TargetsCommand.call_count == 1
def test_edit_command(self, edit_command): cli.main(['edit', 'foo']) assert edit_command.call_count == 1
def test_sync_command(self, SyncCommand, command): cli.main([command, "foo"]) assert SyncCommand.call_count == 1
def test_edit_command(self, EditCommand, command): cli.main([command, "foo"]) assert EditCommand.call_count == 1
def test_daemon_command(self, DaemonCommand, command): cli.main([command]) assert DaemonCommand.call_count == 1
def test_ls_command(self, LsCommand): cli.main(["ls", "foo"]) assert LsCommand.call_count == 1
def test_version_command(self, capsys, command): cli.main([command]) out, err = capsys.readouterr() assert out == "{}\n".format(cli.VERSION)
def test_daemon_command(self, daemon_command): cli.main(['daemon']) assert daemon_command.call_count == 1
def test_rm_command(self, RmCommand): cli.main(["rm", "foo"]) assert RmCommand.call_count == 1
def test_sync_command(self, sync_command): cli.main(['sync', 'foo']) assert sync_command.call_count == 1
def test_add_command(self, AddCommand, command): cli.main([command]) assert AddCommand.call_count == 1
def test_targets_command(self, targets_command): cli.main(['targets']) assert targets_command.call_count == 1
def test_no_arguments_prints_help(self, print_help): cli.main([]) assert print_help.call_count == 1
def test_add_command(self, add_command): cli.main(['add']) assert add_command.call_count == 1
def test_timestamps(self, basicConfig, loglevel): cli.main(["--timestamps", "--log-level", loglevel, "version"]) assert basicConfig.call_args[1]["format"].startswith("%(asctime)s: ")