1# Copyright 2014 Nick Boultbee 2# 3# This program is free software; you can redistribute it and/or modify 4# it under the terms of the GNU General Public License as published by 5# the Free Software Foundation; either version 2 of the License, or 6# (at your option) any later version. 7 8from .helper import capture_output 9from quodlibet import cli 10from tests import TestCase 11 12 13class Tcli(TestCase): 14 15 def test_process_no_arguments_works(self): 16 with capture_output() as (out, err): 17 cli.process_arguments(["myprog"]) 18 self.assertFalse(out.getvalue()) 19 self.assertFalse(err.getvalue()) 20 21 def test_process_arguments_errors_on_invalid_opt(self): 22 with self.assertRaises(SystemExit): 23 with capture_output(): 24 cli.process_arguments(["myprog", "--wrong-thing"]) 25