diff options
Diffstat (limited to 'src/distutils2/tests')
| -rw-r--r-- | src/distutils2/tests/PKG-INFO | 6 | ||||
| -rw-r--r-- | src/distutils2/tests/test_dist.py | 2 | ||||
| -rw-r--r-- | src/distutils2/tests/test_metadata.py | 20 |
3 files changed, 23 insertions, 5 deletions
diff --git a/src/distutils2/tests/PKG-INFO b/src/distutils2/tests/PKG-INFO index c761086..f48546e 100644 --- a/src/distutils2/tests/PKG-INFO +++ b/src/distutils2/tests/PKG-INFO @@ -45,15 +45,13 @@ Description: CLVault |a keyring while the description is saved in a ``.clvault`` file in your |home directory. This file is created automatically the first time the command |is used. - + | |*clvault-get* copies the password for a given service in your clipboard, and |displays the associated user if any. - + | |*clvault-list* lists all registered services, with their description when |given. | | |Project page: http://bitbucket.org/tarek/clvault | - - diff --git a/src/distutils2/tests/test_dist.py b/src/distutils2/tests/test_dist.py index 9bfa2e7..fcf333b 100644 --- a/src/distutils2/tests/test_dist.py +++ b/src/distutils2/tests/test_dist.py @@ -391,7 +391,7 @@ class MetadataTestCase(support.TempdirManager, support.EnvironGuard, dist = distutils2.dist.Distribution(attrs) meta = self.format_metadata(dist) - meta = meta.replace('\n' + 8 * ' ', '\n') + meta = meta.replace('\n' + 7 * ' ' + '|', '\n') self.assertTrue(long_desc in meta) def test_read_metadata(self): diff --git a/src/distutils2/tests/test_metadata.py b/src/distutils2/tests/test_metadata.py index 10237bf..f259463 100644 --- a/src/distutils2/tests/test_metadata.py +++ b/src/distutils2/tests/test_metadata.py @@ -73,6 +73,26 @@ class DistributionMetadataTestCase(unittest2.TestCase): metadata.read_file(StringIO(content)) self.assertEquals(metadata['Requires-Dist'], ['bar']) + def test_description(self): + PKG_INFO = os.path.join(os.path.dirname(__file__), 'PKG-INFO') + content = open(PKG_INFO).read() + content = content % sys.platform + metadata = DistributionMetadata() + metadata.read_file(StringIO(content)) + + # see if we can read the description now + DESC = os.path.join(os.path.dirname(__file__), 'LONG_DESC.txt') + wanted = open(DESC).read() + self.assertEquals(wanted, metadata['Description']) + + # save the file somewhere and make sure we can read it back + out = StringIO() + metadata.write_file(out) + out.seek(0) + metadata.read_file(out) + self.assertEquals(wanted, metadata['Description']) + + def test_suite(): return unittest2.makeSuite(DistributionMetadataTestCase) |
