Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Package renamed from pgxn.client to pgxnclient

After the comment from Marti (Raudesepp, I bet) that the point would lead
to renames by the distributions.
  • Loading branch information...
commit 80ce47ed2931b5833b2343e24bbb7515b427c4d4 1 parent 7e81c63
@dvarrazzo authored
View
2  Makefile
@@ -1,4 +1,4 @@
-# pgxn.client Makefile
+# pgxnclient Makefile
#
# Copyright (C) 2011 Daniele Varrazzo
#
View
10 pgxn/__init__.py
@@ -1,10 +0,0 @@
-"""
-pgxn.client -- pgxn package
-
-This package is currently only meant as a placeholder.
-"""
-
-# Copyright (C) 2011 Daniele Varrazzo
-
-# This file is part of the PGXN client
-
View
10 pgxn/client/__init__.py → pgxnclient/__init__.py
@@ -1,5 +1,5 @@
"""
-pgxn.client -- main package
+pgxnclient -- main package
"""
# Copyright (C) 2011 Daniele Varrazzo
@@ -13,11 +13,11 @@
import re
import operator as _op
-from pgxn.client.i18n import _
-from pgxn.client.errors import BadSpecError, ResourceNotFound
+from pgxnclient.i18n import _
+from pgxnclient.errors import BadSpecError, ResourceNotFound
-from pgxn.utils.semver import SemVer
-from pgxn.utils.label import Label
+from pgxnclient.utils.semver import SemVer
+from pgxnclient.utils.label import Label
class Spec(object):
View
8 pgxn/client/api.py → pgxnclient/api.py
@@ -1,5 +1,5 @@
"""
-pgxn.client -- client API stub
+pgxnclient -- client API stub
"""
# Copyright (C) 2011 Daniele Varrazzo
@@ -8,9 +8,9 @@
from urllib import urlencode
-from pgxn.utils import json
-from pgxn.utils.uri import expand_template
-from pgxn.client.network import get_file
+from pgxnclient.utils import json
+from pgxnclient.utils.uri import expand_template
+from pgxnclient.network import get_file
class Api(object):
def __init__(self, mirror):
View
4 pgxn/client/cli.py → pgxnclient/cli.py
@@ -1,5 +1,5 @@
"""
-pgxn.client -- command line entry point
+pgxnclient -- command line entry point
"""
# Copyright (C) 2011 Daniele Varrazzo
@@ -8,7 +8,7 @@
import sys
-from pgxn.client.commands import get_option_parser, run_commands
+from pgxnclient.commands import get_option_parser, run_commands
def main(argv=None):
if argv is None:
View
32 pgxn/client/commands.py → pgxnclient/commands.py
@@ -1,5 +1,5 @@
"""
-pgxn.client -- commands module
+pgxnclient -- commands module
"""
# Copyright (C) 2011 Daniele Varrazzo
@@ -8,17 +8,17 @@
import os
import logging
-from pgxn.utils import json
-from pgxn.utils import argparse
+from pgxnclient.utils import json
+from pgxnclient.utils import argparse
-from pgxn.client import __version__
-from pgxn.client import Spec, Label, SemVer
-from pgxn.client.api import Api
-from pgxn.client.i18n import _, N_, gettext
-from pgxn.client.errors import PgxnClientException, UserAbort
-from pgxn.client.network import download
+from pgxnclient import __version__
+from pgxnclient import Spec, Label, SemVer
+from pgxnclient.api import Api
+from pgxnclient.i18n import _, N_, gettext
+from pgxnclient.errors import PgxnClientException, UserAbort
+from pgxnclient.network import download
-logger = logging.getLogger('pgxn.client.commands')
+logger = logging.getLogger('pgxnclient.commands')
def get_option_parser():
parser = argparse.ArgumentParser(
@@ -133,7 +133,7 @@ def confirm(self, prompt):
prompt = _("Please answer yes or no")
-from pgxn.client.errors import ResourceNotFound
+from pgxnclient.errors import ResourceNotFound
class Mirror(Command):
name = 'mirror'
@@ -202,8 +202,8 @@ def run(self):
print "%s %s" % (hit['dist'], hit['version'])
-from pgxn.client.errors import BadSpecError
-from pgxn.utils.zip import get_meta_from_zip
+from pgxnclient.errors import BadSpecError
+from pgxnclient.utils.zip import get_meta_from_zip
class CommandWithSpec(Command):
# TODO: the spec should possibly be a local file or a full url
@@ -402,8 +402,8 @@ def print_details(self, spec, ver):
print "%s: %s: %s %s" % (phase, rel, pkg, ver)
-from pgxn.utils import sha1
-from pgxn.client.errors import BadChecksum
+from pgxnclient.utils import sha1
+from pgxnclient.errors import BadChecksum
class Download(CommandWithSpec):
name = 'download'
@@ -468,7 +468,7 @@ def _get_local_file_name(self, url):
import shutil
import tempfile
from subprocess import Popen, PIPE
-from pgxn.utils.zip import unpack
+from pgxnclient.utils.zip import unpack
class WithUnpacking(object):
def call_with_temp_dir(self, f, *args, **kwargs):
View
4 pgxn/client/errors.py → pgxnclient/errors.py
@@ -1,5 +1,5 @@
"""
-pgxn.client -- package exceptions
+pgxnclient -- package exceptions
These exceptions can be used to signal expected problems and to exit in a
controlled way from the program.
@@ -14,7 +14,7 @@ class PgxnException(Exception):
"""Base class for the exceptions known in the pgxn package."""
class PgxnClientException(PgxnException):
- """Base class for the exceptions raised by the pgxn.client package."""
+ """Base class for the exceptions raised by the pgxnclient package."""
class UserAbort(PgxnClientException):
"""The user requested to stop the operation."""
View
2  pgxn/client/i18n.py → pgxnclient/i18n.py
@@ -1,5 +1,5 @@
"""
-pgxn.client -- internationalization support
+pgxnclient -- internationalization support
"""
# Copyright (C) 2011 Daniele Varrazzo
View
12 pgxn/client/network.py → pgxnclient/network.py
@@ -1,5 +1,5 @@
"""
-pgxn.client -- network interaction
+pgxnclient -- network interaction
"""
# Copyright (C) 2011 Daniele Varrazzo
@@ -10,16 +10,16 @@
import urllib2
from itertools import count
-from pgxn.client import __version__
-from pgxn.client.i18n import _
-from pgxn.client.errors import NetworkError, ResourceNotFound, BadRequestError
+from pgxnclient import __version__
+from pgxnclient.i18n import _
+from pgxnclient.errors import NetworkError, ResourceNotFound, BadRequestError
import logging
-logger = logging.getLogger('pgxn.client.network')
+logger = logging.getLogger('pgxnclient.network')
def get_file(url):
opener = urllib2.build_opener()
- opener.addheaders = [('User-agent', 'pgxn.client/%s' % __version__)]
+ opener.addheaders = [('User-agent', 'pgxnclient/%s' % __version__)]
logger.debug('opening url: %s', url)
try:
return opener.open(url)
View
2  pgxn/utils/__init__.py → pgxnclient/utils/__init__.py
@@ -1,5 +1,5 @@
"""
-pgxn.client -- misc utilities package
+pgxnclient -- misc utilities package
"""
# Copyright (C) 2011 Daniele Varrazzo
View
0  pgxn/utils/argparse.py → pgxnclient/utils/argparse.py
File renamed without changes
View
2  pgxn/utils/label.py → pgxnclient/utils/label.py
@@ -9,7 +9,7 @@
import re
-from pgxn.client.i18n import _
+from pgxnclient.i18n import _
class Label(str):
View
2  pgxn/utils/semver.py → pgxnclient/utils/semver.py
@@ -22,7 +22,7 @@
import re
import operator
-from pgxn.client.i18n import _
+from pgxnclient.i18n import _
class SemVer(str):
"""A string representing a semantic version number.
View
0  pgxn/utils/uri.py → pgxnclient/utils/uri.py
File renamed without changes
View
10 pgxn/utils/zip.py → pgxnclient/utils/zip.py
@@ -1,5 +1,5 @@
"""
-pgxn.client -- zip file utilities
+pgxnclient -- zip file utilities
"""
# Copyright (C) 2011 Daniele Varrazzo
@@ -11,12 +11,12 @@
import shutil
from zipfile import ZipFile
-from pgxn.utils import json
-from pgxn.client.i18n import _
-from pgxn.client.errors import PgxnClientException
+from pgxnclient.utils import json
+from pgxnclient.i18n import _
+from pgxnclient.errors import PgxnClientException
import logging
-logger = logging.getLogger('pgxn.utils.zip')
+logger = logging.getLogger('pgxnclient.utils.zip')
def unpack(zipname, destdir):
logger.info(_("unpacking: %s"), zipname)
View
8 scripts/pgxncli.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
"""
-pgxn.client -- command line interface
+pgxnclient -- command line interface
"""
# Copyright (C) 2011 Daniele Varrazzo
@@ -9,9 +9,9 @@
import sys
-from pgxn.client.cli import main
-from pgxn.client.i18n import _
-from pgxn.client.errors import PgxnException, UserAbort
+from pgxnclient.cli import main
+from pgxnclient.i18n import _
+from pgxnclient.errors import PgxnException, UserAbort
import logging
logging.basicConfig(
View
8 setup.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
"""
-pgxn.client -- setup script
+pgxnclient -- setup script
"""
# Copyright (C) 2011 Daniele Varrazzo
@@ -10,15 +10,15 @@
from distutils.core import setup
-from pgxn.client import __version__
+from pgxnclient import __version__
-setup(name='pgxn.client',
+setup(name='pgxnclient',
version=__version__,
description='A command line tool to interact with the PostgreSQL Extension Network.',
author='Daniele Varrazzo',
author_email='daniele.varrazzo@gmail.com',
url='https://github.com/dvarrazzo/pgxn-client/',
- packages=['pgxn', 'pgxn.client', 'pgxn.utils'],
+ packages=['pgxnclient', 'pgxnclient.utils'],
scripts=['scripts/pgxn', 'scripts/pgxncli.py'],
license='BSD',
)
View
148 tests/test_commands.py
@@ -23,10 +23,10 @@ def fake_get_file(url, urlmap=None):
class ListTestCase(TestCase):
def _get_output(self, cmdline):
@patch('sys.stdout')
- @patch('pgxn.client.api.get_file')
+ @patch('pgxnclient.api.get_file')
def do(mock, stdout):
mock.side_effect = fake_get_file
- from pgxn.client.cli import main
+ from pgxnclient.cli import main
main(cmdline)
return u''.join([a[0] for a, k in stdout.write.call_args_list]) \
.encode('ascii')
@@ -54,35 +54,35 @@ def test_list_empty(self):
class DownloadTestCase(TestCase):
- @patch('pgxn.client.api.get_file')
+ @patch('pgxnclient.api.get_file')
def test_download_latest(self, mock):
mock.side_effect = fake_get_file
fn = 'foobar-0.42.1.pgz'
self.assert_(not os.path.exists(fn))
- from pgxn.client.cli import main
+ from pgxnclient.cli import main
try:
main(['download', 'foobar'])
self.assert_(os.path.exists(fn))
finally:
ifunlink(fn)
- @patch('pgxn.client.api.get_file')
+ @patch('pgxnclient.api.get_file')
def test_download_testing(self, mock):
mock.side_effect = fake_get_file
fn = 'foobar-0.43.2b1.pgz'
self.assert_(not os.path.exists(fn))
- from pgxn.client.cli import main
+ from pgxnclient.cli import main
try:
main(['download', '--testing', 'foobar'])
self.assert_(os.path.exists(fn))
finally:
ifunlink(fn)
- @patch('pgxn.client.api.get_file')
+ @patch('pgxnclient.api.get_file')
def test_download_rename(self, mock):
mock.side_effect = fake_get_file
@@ -98,7 +98,7 @@ def test_download_rename(self, mock):
f.write('test')
f.close()
- from pgxn.client.cli import main
+ from pgxnclient.cli import main
main(['download', 'foobar'])
self.assert_(os.path.exists(fn1))
self.assert_(not os.path.exists(fn2))
@@ -115,7 +115,7 @@ def test_download_rename(self, mock):
ifunlink(fn1)
ifunlink(fn2)
- @patch('pgxn.client.api.get_file')
+ @patch('pgxnclient.api.get_file')
def test_download_bad_sha1(self, mock):
def fakefake(url):
return fake_get_file(url, urlmap = {
@@ -128,8 +128,8 @@ def fakefake(url):
self.assert_(not os.path.exists(fn))
try:
- from pgxn.client.cli import main
- from pgxn.client.errors import BadChecksum
+ from pgxnclient.cli import main
+ from pgxnclient.errors import BadChecksum
e = self.assertRaises(BadChecksum,
main, ['download', 'foobar'])
@@ -139,9 +139,9 @@ def fakefake(url):
ifunlink(fn)
def test_version(self):
- from pgxn.client import Spec
- from pgxn.client.commands import Download
- from pgxn.client.errors import ResourceNotFound
+ from pgxnclient import Spec
+ from pgxnclient.commands import Download
+ from pgxnclient.errors import ResourceNotFound
opt = Mock()
opt.status = Spec.STABLE
@@ -209,36 +209,36 @@ def test_version(self):
class InstallTestCase(TestCase):
- @patch('pgxn.client.commands.Popen')
- @patch('pgxn.client.api.get_file')
+ @patch('pgxnclient.commands.Popen')
+ @patch('pgxnclient.api.get_file')
def test_install_latest(self, mock_get, mock_popen):
mock_get.side_effect = fake_get_file
pop = mock_popen.return_value
pop.returncode = 0
- from pgxn.client.cli import main
+ from pgxnclient.cli import main
main(['install', 'foobar'])
self.assertEquals(mock_popen.call_count, 2)
self.assertEquals(['make'], mock_popen.call_args_list[0][0][0][:1])
self.assertEquals(['sudo', 'make'], mock_popen.call_args_list[1][0][0][:2])
- @patch('pgxn.client.commands.Popen')
- @patch('pgxn.client.api.get_file')
+ @patch('pgxnclient.commands.Popen')
+ @patch('pgxnclient.api.get_file')
def test_install_fails(self, mock_get, mock_popen):
mock_get.side_effect = fake_get_file
pop = mock_popen.return_value
pop.returncode = 1
- from pgxn.client.cli import main
- from pgxn.client.errors import PgxnClientException
+ from pgxnclient.cli import main
+ from pgxnclient.errors import PgxnClientException
self.assertRaises(PgxnClientException, main, ['install', 'foobar'])
self.assertEquals(mock_popen.call_count, 1)
- @patch('pgxn.client.commands.Popen')
- @patch('pgxn.client.api.get_file')
+ @patch('pgxnclient.commands.Popen')
+ @patch('pgxnclient.api.get_file')
def test_install_bad_sha1(self, mock_get, mock_popen):
def fakefake(url):
return fake_get_file(url, urlmap = {
@@ -249,33 +249,33 @@ def fakefake(url):
pop = mock_popen.return_value
pop.returncode = 0
- from pgxn.client.cli import main
- from pgxn.client.errors import BadChecksum
+ from pgxnclient.cli import main
+ from pgxnclient.errors import BadChecksum
self.assertRaises(BadChecksum,
main, ['install', 'foobar'])
- @patch('pgxn.client.commands.Popen')
- @patch('pgxn.client.api.get_file')
+ @patch('pgxnclient.commands.Popen')
+ @patch('pgxnclient.api.get_file')
def test_install_nosudo(self, mock_get, mock_popen):
mock_get.side_effect = fake_get_file
pop = mock_popen.return_value
pop.returncode = 0
- from pgxn.client.cli import main
+ from pgxnclient.cli import main
main(['install', '--nosudo', 'foobar'])
self.assertEquals(mock_popen.call_count, 2)
self.assertEquals(['make'], mock_popen.call_args_list[0][0][0][:1])
self.assertEquals(['make'], mock_popen.call_args_list[1][0][0][:1])
- @patch('pgxn.client.commands.Popen')
- @patch('pgxn.client.api.get_file')
+ @patch('pgxnclient.commands.Popen')
+ @patch('pgxnclient.api.get_file')
def test_install_sudo(self, mock_get, mock_popen):
mock_get.side_effect = fake_get_file
pop = mock_popen.return_value
pop.returncode = 0
- from pgxn.client.cli import main
+ from pgxnclient.cli import main
main(['install', '--sudo', 'gksudo -d "hello world"', 'foobar'])
self.assertEquals(mock_popen.call_count, 2)
@@ -283,17 +283,17 @@ def test_install_sudo(self, mock_get, mock_popen):
self.assertEquals(['gksudo', '-d', 'hello world', 'make'],
mock_popen.call_args_list[1][0][0][:4])
- @patch('pgxn.client.commands.unpack')
- @patch('pgxn.client.commands.Popen')
- @patch('pgxn.client.api.get_file')
+ @patch('pgxnclient.commands.unpack')
+ @patch('pgxnclient.commands.Popen')
+ @patch('pgxnclient.api.get_file')
def test_install_local_zip(self, mock_get, mock_popen, mock_unpack):
mock_get.side_effect = lambda *args: self.fail('network invoked')
pop = mock_popen.return_value
pop.returncode = 0
- from pgxn.utils.zip import unpack
+ from pgxnclient.utils.zip import unpack
mock_unpack.side_effect = unpack
- from pgxn.client.cli import main
+ from pgxnclient.cli import main
main(['install', get_test_filename('foobar-0.42.1.pgz')])
self.assertEquals(mock_popen.call_count, 2)
@@ -307,8 +307,8 @@ def test_install_local_zip(self, mock_get, mock_popen, mock_unpack):
self.assertEqual(zipname, get_test_filename('foobar-0.42.1.pgz'))
self.assertEqual(make_cwd, os.path.join(tmpdir, 'foobar-0.42.1'))
- @patch('pgxn.client.commands.Popen')
- @patch('pgxn.client.api.get_file')
+ @patch('pgxnclient.commands.Popen')
+ @patch('pgxnclient.api.get_file')
def test_install_local_dir(self, mock_get, mock_popen):
mock_get.side_effect = lambda *args: self.fail('network invoked')
pop = mock_popen.return_value
@@ -316,10 +316,10 @@ def test_install_local_dir(self, mock_get, mock_popen):
tdir = tempfile.mkdtemp()
try:
- from pgxn.utils.zip import unpack
+ from pgxnclient.utils.zip import unpack
dir = unpack(get_test_filename('foobar-0.42.1.pgz'), tdir)
- from pgxn.client.cli import main
+ from pgxnclient.cli import main
main(['install', dir])
finally:
@@ -334,35 +334,35 @@ def test_install_local_dir(self, mock_get, mock_popen):
class CheckTestCase(TestCase):
- @patch('pgxn.client.commands.Popen')
- @patch('pgxn.client.api.get_file')
+ @patch('pgxnclient.commands.Popen')
+ @patch('pgxnclient.api.get_file')
def test_check_latest(self, mock_get, mock_popen):
mock_get.side_effect = fake_get_file
pop = mock_popen.return_value
pop.returncode = 0
- from pgxn.client.cli import main
+ from pgxnclient.cli import main
main(['check', 'foobar'])
self.assertEquals(mock_popen.call_count, 1)
self.assertEquals(['make'], mock_popen.call_args_list[0][0][0][:1])
- @patch('pgxn.client.commands.Popen')
- @patch('pgxn.client.api.get_file')
+ @patch('pgxnclient.commands.Popen')
+ @patch('pgxnclient.api.get_file')
def test_check_fails(self, mock_get, mock_popen):
mock_get.side_effect = fake_get_file
pop = mock_popen.return_value
pop.returncode = 1
- from pgxn.client.cli import main
- from pgxn.client.errors import PgxnClientException
+ from pgxnclient.cli import main
+ from pgxnclient.errors import PgxnClientException
self.assertRaises(PgxnClientException, main, ['check', 'foobar'])
self.assertEquals(mock_popen.call_count, 1)
- @patch('pgxn.client.commands.Popen')
- @patch('pgxn.client.api.get_file')
+ @patch('pgxnclient.commands.Popen')
+ @patch('pgxnclient.api.get_file')
def test_check_diff_moved(self, mock_get, mock_popen):
mock_get.side_effect = fake_get_file
@@ -381,8 +381,8 @@ def create_regression_files(*args, **kwargs):
self.assert_(not os.path.exists('regression.diffs'),
"Please remove temp file 'regression.diffs' from current dir")
- from pgxn.client.cli import main
- from pgxn.client.errors import PgxnClientException
+ from pgxnclient.cli import main
+ from pgxnclient.errors import PgxnClientException
try:
self.assertRaises(PgxnClientException, main, ['check', 'foobar'])
@@ -393,8 +393,8 @@ def create_regression_files(*args, **kwargs):
ifunlink('regression.out')
ifunlink('regression.diffs')
- @patch('pgxn.client.commands.Popen')
- @patch('pgxn.client.api.get_file')
+ @patch('pgxnclient.commands.Popen')
+ @patch('pgxnclient.api.get_file')
def test_check_bad_sha1(self, mock_get, mock_popen):
def fakefake(url):
return fake_get_file(url, urlmap = {
@@ -405,8 +405,8 @@ def fakefake(url):
pop = mock_popen.return_value
pop.returncode = 1
- from pgxn.client.cli import main
- from pgxn.client.errors import BadChecksum
+ from pgxnclient.cli import main
+ from pgxnclient.errors import BadChecksum
self.assertRaises(BadChecksum, main, ['check', 'foobar'])
self.assertEquals(mock_popen.call_count, 0)
@@ -414,7 +414,7 @@ def fakefake(url):
class LoadTestCase(TestCase):
def test_parse_version(self):
- from pgxn.client.commands import Load
+ from pgxnclient.commands import Load
cmd = Load(None)
self.assertEquals((9,0,3), cmd.parse_pg_version(
'PostgreSQL 9.0.3 on i686-pc-linux-gnu, compiled by GCC'
@@ -423,10 +423,10 @@ def test_parse_version(self):
'PostgreSQL 9.1alpha5 on i686-pc-linux-gnu, compiled by GCC gcc'
' (Ubuntu/Linaro 4.4.4-14ubuntu5) 4.4.5, 32-bit '))
- @patch('pgxn.client.commands.Load.is_extension')
- @patch('pgxn.client.commands.Load.get_pg_version')
- @patch('pgxn.client.commands.Popen')
- @patch('pgxn.client.api.get_file')
+ @patch('pgxnclient.commands.Load.is_extension')
+ @patch('pgxnclient.commands.Load.get_pg_version')
+ @patch('pgxnclient.commands.Popen')
+ @patch('pgxnclient.api.get_file')
def test_check_psql_options(self,
mock_get, mock_popen, mock_pgver, mock_isext):
mock_get.side_effect = fake_get_file
@@ -436,7 +436,7 @@ def test_check_psql_options(self,
mock_pgver.return_value = (9,1,0)
mock_isext.return_value = True
- from pgxn.client.cli import main
+ from pgxnclient.cli import main
main(['--yes', 'load', '--dbname', 'dbdb', 'foobar'])
args = mock_popen.call_args[0][0]
@@ -454,22 +454,22 @@ def test_check_psql_options(self,
args = mock_popen.call_args[0][0]
self.assertEqual('somewhere', args[args.index('--host') + 1])
- @patch('pgxn.client.commands.Load.is_extension')
- @patch('pgxn.client.commands.Load.get_pg_version')
- @patch('pgxn.client.commands.unpack')
- @patch('pgxn.client.commands.Popen')
- @patch('pgxn.client.api.get_file')
+ @patch('pgxnclient.commands.Load.is_extension')
+ @patch('pgxnclient.commands.Load.get_pg_version')
+ @patch('pgxnclient.commands.unpack')
+ @patch('pgxnclient.commands.Popen')
+ @patch('pgxnclient.api.get_file')
def test_load_local_zip(self, mock_get, mock_popen, mock_unpack,
mock_pgver, mock_isext):
mock_get.side_effect = lambda *args: self.fail('network invoked')
pop = mock_popen.return_value
pop.returncode = 0
- from pgxn.utils.zip import unpack
+ from pgxnclient.utils.zip import unpack
mock_unpack.side_effect = unpack
mock_pgver.return_value = (9,1,0)
mock_isext.return_value = True
- from pgxn.client.cli import main
+ from pgxnclient.cli import main
main(['--yes', 'load', get_test_filename('foobar-0.42.1.pgz')])
self.assertEquals(mock_unpack.call_count, 0)
@@ -479,10 +479,10 @@ def test_load_local_zip(self, mock_get, mock_popen, mock_unpack,
'CREATE EXTENSION foobar;')
- @patch('pgxn.client.commands.Load.is_extension')
- @patch('pgxn.client.commands.Load.get_pg_version')
- @patch('pgxn.client.commands.Popen')
- @patch('pgxn.client.api.get_file')
+ @patch('pgxnclient.commands.Load.is_extension')
+ @patch('pgxnclient.commands.Load.get_pg_version')
+ @patch('pgxnclient.commands.Popen')
+ @patch('pgxnclient.api.get_file')
def test_load_local_dir(self, mock_get, mock_popen,
mock_pgver, mock_isext):
mock_get.side_effect = lambda *args: self.fail('network invoked')
@@ -493,10 +493,10 @@ def test_load_local_dir(self, mock_get, mock_popen,
tdir = tempfile.mkdtemp()
try:
- from pgxn.utils.zip import unpack
+ from pgxnclient.utils.zip import unpack
dir = unpack(get_test_filename('foobar-0.42.1.pgz'), tdir)
- from pgxn.client.cli import main
+ from pgxnclient.cli import main
main(['--yes', 'load', dir])
finally:
View
2  tests/test_label.py
@@ -1,6 +1,6 @@
from unittest2 import TestCase
-from pgxn.client import Label
+from pgxnclient import Label
class LabelTestCase(TestCase):
def test_ok(self):
View
2  tests/test_semver.py
@@ -1,6 +1,6 @@
from unittest2 import TestCase
-from pgxn.client import SemVer
+from pgxnclient import SemVer
class SemVerTestCase(TestCase):
def test_ok(self):
View
2  tests/testutils.py
@@ -1,5 +1,5 @@
"""
-pgxn.client -- unit test utilities
+pgxnclient -- unit test utilities
"""
# Copyright (C) 2011 Daniele Varrazzo
Please sign in to comment.
Something went wrong with that request. Please try again.