Package tests :: Module test_Control
[hide private]
[frames] | no frames]

Module test_Control

Test gbp.deb.control.Control

Functions [hide private]
 
test_parse_control()
Parse a the control of debian package
 
test_no_control_error()
Raise an error if no control file exist or is empty
Variables [hide private]
  cl_debian = 'Source: git-buildpackage\nSection: vcs\nPriority:...
  __package__ = 'tests'
Function Details [hide private]

test_parse_control()

 

Parse a the control of debian package

Methods tested:

Properties tested:

>>> import gbp.deb.control
>>> cl = gbp.deb.control.Control(cl_debian)
>>> cl.name
'git-buildpackage'
>>> cl.name == cl['Source']
True
>>> cl.section
'vcs'
>>> cl.section == cl['Section']
True
>>> cl.priority
'optional'
>>> cl.priority == cl['Priority']
True
>>> cl['Standards-Version']
'3.9.3'
>>> cl['Package']

test_no_control_error()

 

Raise an error if no control file exist or is empty

Methods tested:

>>> import gbp.deb.control
>>> cl = gbp.deb.control.Control(filename="doesnotexist")
Traceback (most recent call last):
...
NoControlError: Control file doesnotexist does not exist
>>> cl = gbp.deb.control.Control("notparsable")
Traceback (most recent call last):
...
ParseControlError: Empty or invalid control file or contents

Variables Details [hide private]

cl_debian

Value:
'''Source: git-buildpackage
Section: vcs
Priority: optional
Maintainer: Guido G\xc3\xbcnther <agx@sigxcpu.org>
Build-Depends: debhelper (>= 7.0.50~), python (>> 2.6.6-3~),
 pychecker, gtk-doc-tools, sgml2x, docbook-utils, jade, python-dateuti\
l, python-nose,
 bash-completion, perl, python-epydoc, python-coverage, python-setupto\
...