[py-svn] r7013 - in py/dist/py: . misc
hpk at codespeak.net
hpk at codespeak.net
Mon Oct 18 22:34:11 CEST 2004
Author: hpk
Date: Mon Oct 18 22:34:10 2004
New Revision: 7013
Added:
py/dist/py/misc/ (props changed)
py/dist/py/misc/__init__.py
py/dist/py/misc/test_api.py
- copied unchanged from r6999, py/dist/py/test_api.py
py/dist/py/misc/test_initpkg.py
- copied unchanged from r6999, py/dist/py/test_initpkg.py
Removed:
py/dist/py/test_api.py
py/dist/py/test_initpkg.py
Log:
moved some stuff into a separate directory to clean up
the top level and getter better filename completion
on py/test :-)
Added: py/dist/py/misc/__init__.py
==============================================================================
--- (empty file)
+++ py/dist/py/misc/__init__.py Mon Oct 18 22:34:10 2004
@@ -0,0 +1 @@
+#
Deleted: /py/dist/py/test_api.py
==============================================================================
--- /py/dist/py/test_api.py Mon Oct 18 22:34:10 2004
+++ (empty file)
@@ -1,54 +0,0 @@
-
-from py.test import raises
-import py
-import sys
-import inspect
-
-class API_V0_namespace_consistence:
- def test_path_entrypoints(self):
- assert inspect.ismodule(py.path)
- assert_class('py.path', 'local')
- assert_class('py.path', 'svnwc')
- assert_class('py.path', 'svnurl')
- assert_class('py.path', 'py')
- assert_class('py.path', 'checker')
- assert_class('py.path', 'invchecker')
- assert_class('py.path', 'NotFound')
- assert_class('py.path', 'Denied')
-
- def test_magic_entrypoints(self):
- assert_class('py.magic', 'View')
- assert_function('py.magic', 'invoke')
- assert_function('py.magic', 'revoke')
- assert_function('py.magic', 'patch')
- assert_function('py.magic', 'revoke')
-
- assert inspect.ismodule(py.magic.dyncode)
- assert_function('py.magic.dyncode', 'compile')
- assert_function('py.magic.dyncode', 'compile2')
- assert_function('py.magic.dyncode', 'findsource')
- assert_function('py.magic.dyncode', 'getsource')
- assert_function('py.magic.dyncode', 'listtb')
- assert_function('py.magic.dyncode', 'findsource')
-
- def test_process_entrypoints(self):
- assert_function('py.process', 'cmdexec')
-
- def test_utest_entrypoints(self):
- # XXX TOBECOMPLETED
- assert_function('py.test', 'main')
- #assert_module('std.utest', 'collect')
-
-def assert_class(modpath, name):
- mod = __import__(modpath, None, None, [name])
- obj = getattr(mod, name)
- fullpath = modpath + '.' + name
- assert obj.__module__ == modpath
- if sys.version_info >= (2,3):
- assert obj.__name__ == name
-
-def assert_function(modpath, name):
- mod = __import__(modpath, None, None, [name])
- obj = getattr(mod, name)
- assert hasattr(obj, 'func_doc')
- #assert obj.func_name == name
Deleted: /py/dist/py/test_initpkg.py
==============================================================================
--- /py/dist/py/test_initpkg.py Mon Oct 18 22:34:10 2004
+++ (empty file)
@@ -1,60 +0,0 @@
-import py
-import types
-
-def test_dir():
- for name in dir(py):
- if not name.startswith('_'):
- obj = getattr(py, name)
- if isinstance(obj, types.ModuleType):
- keys = dir(obj)
- assert len(keys) > 0
- assert getattr(obj, '__map__') == {}
-
-def test_virtual_module_identity():
- from py import path as path1
- from py import path as path2
- assert path1 is path2
- from py.path import local as local1
- from py.path import local as local2
- assert local1 is local2
-
-def test_importing_all_implementations():
- base = py.path.local(py.__file__).dirpath()
- for p in base.visit('*.py', py.path.checker(dotfile=0)):
- relpath = p.new(ext='').relto(base)
- if base.sep in relpath: # not std/*.py itself
- if relpath.find('test/data') != -1:
- continue
- if relpath.find('bin/') != -1:
- continue
- relpath = relpath.replace(base.sep, '.')
- modpath = 'py.__impl__.%s' % relpath
- assert __import__(modpath)
-
-def test_shahexdigest():
- hex = py.__package__.shahexdigest()
- assert len(hex) == 40
-
-def test_getzipdata():
- s = py.__package__.getzipdata()
-
-# the following test should abasically work in the future
-def XXXtest_virtual_on_the_fly():
- py.initpkg('my', {
- 'x.abspath' : 'os.path.abspath',
- 'x.local' : 'py.path.local',
- 'y' : 'smtplib',
- 'z.cmdexec' : 'py.process.cmdexec',
- })
- from my.x import abspath
- from my.x import local
- import smtplib
- from my import y
- assert y is smtplib
- from my.z import cmdexec
- from py.process import cmdexec as cmdexec2
- assert cmdexec is cmdexec2
-
-##def test_help():
-# help(std.path)
-# #assert False
More information about the pytest-commit
mailing list