def test_invalid_args(self): """Test invalid command line args""" # Non-existing option with assert_raises(SystemExit): adm(['--foo']) # Option without argument with assert_raises(SystemExit): adm(['-c']) # Unknown subcommand with assert_raises(SystemExit): adm(['foocmd'])
def test_stat_fail(self): """Failure cases for the 'stat' subcommand""" # Non-existent cache dir eq_(adm(['-c', 'non-existent', 'stat']), 1)
def test_stat(self): """Basic test for the 'stat' subcommand""" # With debug eq_(adm(['-d', '-c', self.cachedir, 'stat']), 0)
def test_not_implemented(self): """Test a badly written subcommand""" with assert_raises(NotImplementedError): adm(['-c', self.cachedir, 'stat'])