HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //home/arjun/python-apt/tests/test_configuration.py
#!/usr/bin/python3
#
# Copyright (C) 2011 Julian Andres Klode <jak@debian.org>
#
# Copying and distribution of this file, with or without modification,
# are permitted in any medium without royalty provided the copyright
# notice and this notice are preserved.
"""Unit tests for verifying the correctness of apt_pkg.Configuration"""
import unittest

import apt_pkg
import testcommon


class TestConfiguration(testcommon.TestCase):
    """Test various configuration things"""

    def test_lp707416(self):
        """configuration: Test empty arguments (LP: #707416)"""
        self.assertRaises(ValueError, apt_pkg.parse_commandline, apt_pkg.config, [], [])
        self.assertRaises(
            SystemError,
            apt_pkg.parse_commandline,
            apt_pkg.config,
            [],
            ["cmd", "--arg0"],
        )


if __name__ == "__main__":
    unittest.main()