[modutils test] enhance some test names

authorSylvain Thénault <sylvain.thenault@logilab.fr>
changeset4e579e9a9792
branchstable
phasepublic
hiddenno
parent revision#116ff11323fa [registry] type.__new__ first arg is the metaclass, not the class
child revision#5a8fb4b4a7f5 [modutils] fix python3.3 crash on file_from_modpath. Closes #137244
files modified by this revision
test/unittest_modutils.py
# HG changeset patch
# User Sylvain Thénault <sylvain.thenault@logilab.fr>
# Date 1367930557 -7200
# Tue May 07 14:42:37 2013 +0200
# Branch stable
# Node ID 4e579e9a97922a94624c2d04ae1af5268f0d487c
# Parent 116ff11323fae718af44158acdc30c07875fdab1
[modutils test] enhance some test names

diff --git a/test/unittest_modutils.py b/test/unittest_modutils.py
@@ -1,6 +1,6 @@
1 -# copyright 2003-2012 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
2 +# copyright 2003-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
3  # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
4  #
5  # This file is part of logilab-common.
6  #
7  # logilab-common is free software: you can redistribute it and/or modify it under
@@ -141,36 +141,38 @@
8  class file_from_modpath_tc(ModutilsTestCase):
9      """given a mod path (i.e. splited module / package name), return the
10      corresponding file, giving priority to source file over precompiled file
11      if it exists"""
12 
13 -    def test_knownValues_file_from_modpath_1(self):
14 +    def test_site_packages(self):
15          self.assertEqual(path.realpath(modutils.file_from_modpath(['logilab', 'common', 'modutils'])),
16                           path.realpath(modutils.__file__.replace('.pyc', '.py')))
17 
18 -    def test_knownValues_file_from_modpath_2(self):
19 +    def test_std_lib(self):
20          from os import path
21          self.assertEqual(path.realpath(modutils.file_from_modpath(['os', 'path']).replace('.pyc', '.py')),
22                           path.realpath(path.__file__.replace('.pyc', '.py')))
23 
24 -    def test_knownValues_file_from_modpath_3(self):
25 +    def test_xmlplus(self):
26          try:
27              # don't fail if pyxml isn't installed
28              from xml.dom import ext
29          except ImportError:
30              pass
31          else:
32              self.assertEqual(path.realpath(modutils.file_from_modpath(['xml', 'dom', 'ext']).replace('.pyc', '.py')),
33                               path.realpath(ext.__file__.replace('.pyc', '.py')))
34 
35 -    def test_knownValues_file_from_modpath_4(self):
36 +    def test_builtin(self):
37          self.assertEqual(modutils.file_from_modpath(['sys']),
38                           None)
39 
40 -    def test_raise_file_from_modpath_Exception(self):
41 +
42 +    def test_unexisting(self):
43          self.assertRaises(ImportError, modutils.file_from_modpath, ['turlututu'])
44 
45 +
46  class get_source_file_tc(ModutilsTestCase):
47 
48      def test(self):
49          from os import path
50          self.assertEqual(modutils.get_source_file(path.__file__),