Permalink
Browse files

Added tests for the mirror command

  • Loading branch information...
1 parent 58cc381 commit 8e08a9a540fb13422642c59babaffdab5a044c84 @dvarrazzo committed Jul 10, 2012
Showing with 128 additions and 0 deletions.
  1. +30 −0 pgxnclient/tests/test_commands.py
  2. +98 −0 testdata/http%3A%2F%2Fapi.pgxn.org%2Fmeta%2Fmirrors.json
@@ -33,6 +33,7 @@ def f(what):
return f
+
class InfoTestCase(unittest.TestCase):
def _get_output(self, cmdline):
@patch('sys.stdout')
@@ -71,6 +72,35 @@ def test_info_case_insensitive(self):
foobar 0.43.2b1 testing
foobar 0.42.1 stable
foobar 0.42.0 stable
+"""))
+
+ def test_mirrors_list(self):
+ output = self._get_output(['mirror'])
+ self.assertEqual(output, b("""\
+http://pgxn.depesz.com/
+http://www.postgres-support.ch/pgxn/
+http://pgxn.justatheory.com/
+http://pgxn.darkixion.com/
+http://mirrors.cat.pdx.edu/pgxn/
+http://pgxn.dalibo.org/
+http://pgxn.cxsoftware.org/
+http://api.pgxn.org/
+"""))
+
+ def test_mirror_info(self):
+ output = self._get_output(['mirror', 'http://pgxn.justatheory.com/'])
+ self.assertEqual(output, b("""\
+uri: http://pgxn.justatheory.com/
+frequency: daily
+location: Portland, OR, USA
+bandwidth: Cable
+organization: David E. Wheeler
+email: justatheory.com|pgxn
+timezone: America/Los_Angeles
+src: rsync://master.pgxn.org/pgxn/
+rsync:
+notes:
+
"""))
@@ -0,0 +1,98 @@
+[
+ {
+ "uri": "http://pgxn.depesz.com/",
+ "frequency": "every 6 hours",
+ "location": "Nürnberg, Germany",
+ "organization": "depesz Software Hubert Lubaczewski",
+ "timezone": "CEST",
+ "email": "depesz.com|web_pgxn",
+ "bandwidth": "100Mbps",
+ "src": "rsync://master.pgxn.org/pgxn/",
+ "rsync": "",
+ "notes": "access via http only"
+ },
+ {
+ "uri": "http://www.postgres-support.ch/pgxn/",
+ "frequency": "hourly",
+ "location": "Basel, Switzerland, Europe",
+ "organization": "micro systems",
+ "timezone": "CEST",
+ "email": "msys.ch|marc",
+ "bandwidth": "10Mbps",
+ "src": "rsync://master.pgxn.org/pgxn",
+ "rsync": "",
+ "notes": ""
+ },
+ {
+ "uri": "http://pgxn.justatheory.com/",
+ "frequency": "daily",
+ "location": "Portland, OR, USA",
+ "organization": "David E. Wheeler",
+ "timezone": "America/Los_Angeles",
+ "email": "justatheory.com|pgxn",
+ "bandwidth": "Cable",
+ "src": "rsync://master.pgxn.org/pgxn/",
+ "rsync": "",
+ "notes": ""
+ },
+ {
+ "uri": "http://pgxn.darkixion.com/",
+ "frequency": "hourly",
+ "location": "London, UK",
+ "organization": "Thom Brown",
+ "timezone": "Europe/London",
+ "email": "darkixion.com|pgxn",
+ "bandwidth": "1Gbps",
+ "src": "rsync://master.pgxn.org/pgxn",
+ "rsync": "rsync://pgxn.darkixion.com/pgxn",
+ "notes": ""
+ },
+ {
+ "uri": "http://mirrors.cat.pdx.edu/pgxn/",
+ "frequency": "hourly",
+ "location": "Portland, OR, USA",
+ "organization": "PSU Computer Action Team",
+ "timezone": "America/Los_Angeles",
+ "email": "cat.pdx.edu|support",
+ "bandwidth": "60Mbsec",
+ "src": "rsync://master.pgxn.org/pgxn",
+ "rsync": "rsync://mirrors.cat.pdx.edu/pgxn",
+ "notes": "I2 and IPv6"
+ },
+ {
+ "uri": "http://pgxn.dalibo.org/",
+ "frequency": "hourly",
+ "location": "Marseille, France",
+ "organization": "DALIBO SARL",
+ "timezone": "CEST",
+ "email": "dalibo.com|contact",
+ "bandwidth": "100Mbps",
+ "src": "rsync://master.pgxn.org/pgxn/",
+ "rsync": "",
+ "notes": ""
+ },
+ {
+ "uri": "http://pgxn.cxsoftware.org/",
+ "frequency": "hourly",
+ "location": "Seattle, WA, USA",
+ "organization": "CxNet",
+ "timezone": "America/Los_Angeles",
+ "email": "cxnet.cl|cristobal",
+ "bandwidth": "100Mbps",
+ "src": "rsync://master.pgxn.org/pgxn/",
+ "rsync": "",
+ "notes": ""
+ },
+ {
+ "uri": "http://api.pgxn.org/",
+ "frequency": "hourly",
+ "location": "Portland, OR, USA",
+ "organization": "PGXN",
+ "timezone": "America/Los_Angeles",
+ "email": "pgexperts.com|pgxn",
+ "bandwidth": "10MBps",
+ "src": "rsync://master.pgxn.org/pgxn",
+ "rsync": "",
+ "notes": "API server."
+ }
+]

0 comments on commit 8e08a9a

Please sign in to comment.