3 # Check utils.parse_changes()'s for handling of multi-line fields
4 # Copyright (C) 2000 James Troup <james@nocrew.org>
5 # $Id: test.py,v 1.2 2002-10-16 02:47:32 troup Exp $
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2 of the License, or
10 # (at your option) any later version.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 ################################################################################
23 # The deal here is that for the first 6 months of katie's
24 # implementation it has been misparsing multi-line fields in .changes
25 # files; specifically multi-line fields where there _is_ data on the
26 # first line. So, for example:
31 # Became "foo: bar bazbat bant" rather than "foo: bar baz\nbat bant"
33 ################################################################################
37 sys.path.append(os.path.abspath('../../'));
41 ################################################################################
44 sys.stderr.write("%s\n" % (message));
47 ################################################################################
50 # Valid .changes file with a multi-line Binary: field
52 changes = utils.parse_changes('krb5_1.2.2-4_m68k.changes', 0)
53 except utils.changes_parse_error_exc, line:
54 fail("parse_changes() returned an exception with error message `%s'." % (line));
56 o = changes.get("binary", "")
59 changes["binary"] = {}
61 changes["binary"][j] = 1
63 if not changes["binary"].has_key("krb5-ftpd"):
64 fail("parse_changes() is broken; 'krb5-ftpd' is not in the Binary: dictionary.");
66 ################################################################################
68 if __name__ == '__main__':