# `doctests.test_Control` module documentation

Part of `doctests`

Test `gbp.deb.control.Control`

Variable | cl_debian | Undocumented
Function | test_parse_control | Parse a the control of debian package
Function | test_no_control_error | Raise an error if no control file exist or is empty

cl_debian =
Undocumented
(type: `str`)
def test_parse_control():

Parse a the control of debian package

Methods tested:

- `gbp.deb.control.Control.__init__`

Properties tested:

- `gbp.deb.control.Control.name`
- `gbp.deb.control.Control.section`
- `gbp.deb.control.Control.priority`

    >>> 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']

def test_no_control_error():

Raise an error if no control file exist or is empty

Methods tested:

- `gbp.deb.control.Control.__init__`

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