Rev 2: publishing_product tied down in file:///home/jelmer/bzr-email/cmd/

Jelmer Vernooij jelmer at samba.org
Wed Jul 4 01:01:16 BST 2007


At file:///home/jelmer/bzr-email/cmd/

------------------------------------------------------------
revno: 2
revision-id: robertc at robertcollins.net-20051018115959-cdae22c32cf30fe8
parent: robertc at robertcollins.net-20051018073912-190f2394d102b906
committer: Robert Collins <robertc at robertcollins.net>
timestamp: Tue 2005-10-18 21:59:59 +1000
message:
  publishing_product tied down
modified:
  tests/testpublish.py           testpublish.py-20051018071212-e3a53d78c05e0e0a
=== modified file 'tests/testpublish.py'
--- a/tests/testpublish.py	2005-10-18 07:39:12 +0000
+++ b/tests/testpublish.py	2005-10-18 11:59:59 +0000
@@ -29,16 +29,40 @@
 
 
 sample_config=("[DEFAULT]\n"
-               "publishing_root=rsync://example.com/home/archives\n")
+               "publishing_root=rsync://example.com/home/archives\n"
+               "publishing_product=demo\n")
+
+
+sample_version_config=(sample_config + 
+                       "publishing_version=0\n")
 
 
 class TestTest(TestCaseInTempDir):
 
     def test_get_publishing_root(self):
+        my_config = self.get_config()
+        self.assertEqual("rsync://example.com/home/archives", 
+                         my_config.get_user_option("publishing_root"))
+
+    def test_get_publising_product(self):
+        my_config = self.get_config()
+        self.assertEqual("demo",
+                         my_config.get_user_option("publishing_product"))
+
+#    def test_get_publishing_version(self):
+#        my_config = self.get_config()
+#        self.assertEqual(None,
+#                         my_config.get_user_option("publishing_version"))
+#
+#    def test_get_present_publishing_version(self):
+#        my_config = self.get_config(sample_version_config)
+#        self.assertEqual('0',
+#                         my_config.get_user_option("publishing_version"))
+
+    def get_config(self, text=sample_config):
         branch = FakeBranch()
         my_config = config.BranchConfig(branch)
-        config_file = StringIO(sample_config)
+        config_file = StringIO(text)
         (my_config._get_location_config().
             _get_global_config()._get_parser(config_file))
-        self.assertEqual("rsync://example.com/home/archives", 
-                         my_config.get_user_option("publishing_root"))
+        return my_config




More information about the bazaar-commits mailing list