r146 - branches/rewrite/tests/Config

Nat Budin partial-mirror-devel@lists.alioth.debian.org
Sat, 03 Jul 2004 15:18:14 -0600


Author: natbudin-guest
Date: Sat Jul  3 15:18:13 2004
New Revision: 146

Added:
   branches/rewrite/tests/Config/invalidoption.conf
   branches/rewrite/tests/Config/missingrequired.conf
Modified:
   branches/rewrite/tests/Config/test.py
Log:
Added more tests.



Added: branches/rewrite/tests/Config/invalidoption.conf
==============================================================================
--- (empty file)
+++ branches/rewrite/tests/Config/invalidoption.conf	Sat Jul  3 15:18:13 2004
@@ -0,0 +1,81 @@
+;;
+;; debpartial-mirror configuration file.
+;;
+;; $Id: debpartial-mirror.conf 130 2004-07-02 12:33:24Z natbudin-guest $
+
+[GLOBAL]
+;; Show debug information?
+;debug = DEBUG
+
+
+;; Bwahaha!  I can put lots of weirdness into the configuration file.
+;; Otavio and Nat will never catch me!
+xyzzy = plugh
+i_cant_write_a_good_config_file = true
+user = id10t
+;; ... well, damn. :)
+
+;; Mirror destination directory
+mirror_dir = /var/cache/debpartial-mirror/
+
+;; Which architectures should I download?
+architectures = i386
+
+;; What should I look for, by default?
+sections = main
+distributions = stable
+
+;; What should I get?
+get_suggests = true
+get_recommends = true
+get_provides = true
+
+;; Here is our first backend.  It mirrors a subset of packages from the
+;; Debian official repositories.
+[sarge]
+
+;; Where do we get the packages from?
+server = http://ftp.debian.org/debian
+
+;; Since we specify sections and distributions in this section, what we
+;; specify here overrides the settings in [DEFAULT].
+sections = main
+distributions = sarge
+
+;; Only get a subset of the packages in this source.
+filter = subsection:base priority:important
+
+;; Here is another backend.  This one will get all the debian-installer
+;; packages from the unstable distribution (sid).
+[sid_debian-installer]
+server = http://ftp.debian.org/debian
+sections = main/debian-installer
+distributions = sid
+filter = all
+
+;; You can use debian-cd tasks to include or exclude a subset of the
+;; packages.
+include_from_task = /usr/share/debian-cd/tasks/base-sarge
+exclude_from_task = /usr/share/debian-cd/tasks/exclude-sarge
+
+;; This backend is a local repository, as you can see from the use of the
+;; file:// URL.  The idea is that we have a set of custom-made packages
+;; stored on the local computer.
+[local_custom_packages]
+server = file:///var/lib/custom-packages
+sections = main
+distributions = local
+filter = all
+
+;; These packages depend on Debian official packages.  We will use the
+;; "sarge" backend (above) to satisfy these dependencies.
+resolve_deps_using = sarge
+
+;; Here is a merging backend.  It uses the backends we specify above to
+;; create a custom distribution that provides all the packages in each
+;; backend.  This will be created using hard links to the package files
+;; in each backend directory.
+[my_custom_debian_distro]
+backends = sarge sid_debian-installer local_custom_packages
+name = sarge-with-sids-installer-and-some-other-stuff
+filter_sarge = all

Added: branches/rewrite/tests/Config/missingrequired.conf
==============================================================================
--- (empty file)
+++ branches/rewrite/tests/Config/missingrequired.conf	Sat Jul  3 15:18:13 2004
@@ -0,0 +1,74 @@
+;;
+;; debpartial-mirror configuration file.
+;;
+;; $Id: debpartial-mirror.conf 130 2004-07-02 12:33:24Z natbudin-guest $
+
+[GLOBAL]
+;; Show debug information?
+;debug = DEBUG
+
+;; Mirror destination directory
+mirror_dir = /var/cache/debpartial-mirror/
+
+;; Which architectures should I download?
+;; COMMENTED OUT - this is a required option, so it should make this fail
+;architectures = i386
+
+;; What should I look for, by default?
+sections = main
+distributions = stable
+
+;; What should I get?
+get_suggests = true
+get_recommends = true
+get_provides = true
+
+;; Here is our first backend.  It mirrors a subset of packages from the
+;; Debian official repositories.
+[sarge]
+
+;; Where do we get the packages from?
+server = http://ftp.debian.org/debian
+
+;; Since we specify sections and distributions in this section, what we
+;; specify here overrides the settings in [DEFAULT].
+sections = main
+distributions = sarge
+
+;; Only get a subset of the packages in this source.
+filter = subsection:base priority:important
+
+;; Here is another backend.  This one will get all the debian-installer
+;; packages from the unstable distribution (sid).
+[sid_debian-installer]
+server = http://ftp.debian.org/debian
+sections = main/debian-installer
+distributions = sid
+filter = all
+
+;; You can use debian-cd tasks to include or exclude a subset of the
+;; packages.
+include_from_task = /usr/share/debian-cd/tasks/base-sarge
+exclude_from_task = /usr/share/debian-cd/tasks/exclude-sarge
+
+;; This backend is a local repository, as you can see from the use of the
+;; file:// URL.  The idea is that we have a set of custom-made packages
+;; stored on the local computer.
+[local_custom_packages]
+server = file:///var/lib/custom-packages
+sections = main
+distributions = local
+filter = all
+
+;; These packages depend on Debian official packages.  We will use the
+;; "sarge" backend (above) to satisfy these dependencies.
+resolve_deps_using = sarge
+
+;; Here is a merging backend.  It uses the backends we specify above to
+;; create a custom distribution that provides all the packages in each
+;; backend.  This will be created using hard links to the package files
+;; in each backend directory.
+[my_custom_debian_distro]
+backends = sarge sid_debian-installer local_custom_packages
+name = sarge-with-sids-installer-and-some-other-stuff
+filter_sarge = all

Modified: branches/rewrite/tests/Config/test.py
==============================================================================
--- branches/rewrite/tests/Config/test.py	(original)
+++ branches/rewrite/tests/Config/test.py	Sat Jul  3 15:18:13 2004
@@ -57,3 +57,5 @@
 
 
 test('Good configuration file', 'good.conf')
+test('Missing-required configuration file', 'missingrequired.conf', 'RequiredOptionMissing')
+test('Invalid-option configuration file', 'invalidoption.conf', 'InvalidOption')