doctests.test_Control
module documentationdoctests
Test L{gbp.deb.control.Control}
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 |
Parse a the control of debian package Methods tested: - L{gbp.deb.control.Control.__init__} Properties tested: - L{gbp.deb.control.Control.name} - L{gbp.deb.control.Control.section} - L{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']
Raise an error if no control file exist or is empty Methods tested: - L{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