~elementary-os/elementaryos/os-patch-python-apt-bionic

« back to all changes in this revision

Viewing changes to tests/test_configuration.py

  • Committer: RabbitBot
  • Date: 2018-02-05 14:13:49 UTC
  • Revision ID: rabbitbot@elementary.io-20180205141349-gv2qwxlorag06463
Initial import, version 1.4.0~beta3ubuntu1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/python
 
2
#
 
3
# Copyright (C) 2011 Julian Andres Klode <jak@debian.org>
 
4
#
 
5
# Copying and distribution of this file, with or without modification,
 
6
# are permitted in any medium without royalty provided the copyright
 
7
# notice and this notice are preserved.
 
8
"""Unit tests for verifying the correctness of apt_pkg.Configuration"""
 
9
import unittest
 
10
import apt_pkg
 
11
 
 
12
import testcommon
 
13
 
 
14
 
 
15
class TestConfiguration(testcommon.TestCase):
 
16
    """Test various configuration things"""
 
17
 
 
18
    def test_lp707416(self):
 
19
        """configuration: Test empty arguments (LP: #707416)"""
 
20
        self.assertRaises(ValueError, apt_pkg.parse_commandline,
 
21
                          apt_pkg.config, [], [])
 
22
        self.assertRaises(SystemError, apt_pkg.parse_commandline,
 
23
                          apt_pkg.config, [], ["cmd", "--arg0"])
 
24
 
 
25
 
 
26
if __name__ == "__main__":
 
27
    unittest.main()