File: test_configuration.py

package info (click to toggle)
python-apt 1.4.1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 3,980 kB
  • sloc: cpp: 10,003; python: 7,108; makefile: 107; sh: 27
file content (27 lines) | stat: -rw-r--r-- 863 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/python
#
# 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()