コード例 #1
0
ファイル: runtests.py プロジェクト: francescog/distutils2
def test_main():
    run_unittest(distutils2.tests.test_suite())
    run_unittest(btest_suite())
    reap_children()
コード例 #2
0
        metadata = DistributionMetadata()
        metadata['Version'] = '1.0'
        self.assertEqual(metadata.version, PKG_INFO_PREFERRED_VERSION)
        metadata['Classifier'] = ['ok']
        self.assertEqual(metadata.version, '1.2')

    def test_project_urls(self):
        # project-url is a bit specific, make sure we write it
        # properly in PKG-INFO
        metadata = DistributionMetadata()
        metadata['Version'] = '1.0'
        metadata['Project-Url'] = [('one', 'http://ok')]
        self.assertEqual(metadata['Project-Url'], [('one', 'http://ok')])
        file_ = StringIO()
        metadata.write_file(file_)
        file_.seek(0)
        res = file_.read().split('\n')
        self.assertIn('Project-URL: one,http://ok', res)

        file_.seek(0)
        metadata = DistributionMetadata()
        metadata.read_file(file_)
        self.assertEqual(metadata['Project-Url'], [('one', 'http://ok')])


def test_suite():
    return unittest.makeSuite(DistributionMetadataTestCase)

if __name__ == '__main__':
    run_unittest(test_suite())
コード例 #3
0
ファイル: test_pkgutil.py プロジェクト: irslambouf/SyncServer
def test_main():
    run_unittest(test_suite())