def test_description_invalid_rst(self): # make sure bad rst is well handled in the description attribute metadata = Metadata() description = ':funkie:`str`' # mimic Sphinx-specific markup metadata['description'] = description missing, warnings = metadata.check(restructuredtext=True) warning = warnings[0][1] self.assertIn('funkie', warning)
def test_check_homepage(self): metadata = Metadata() metadata['Version'] = '1.0' metadata['Name'] = 'vimpdb' metadata['Author'] = 'Monty Python' metadata.docutils_support = False missing, warnings = metadata.check() self.assertEqual(missing, ['Home-page'])
def test_check_author(self): metadata = Metadata() metadata['Version'] = '1.0' metadata['Name'] = 'vimpdb' metadata['Home-page'] = 'http://pypi.python.org' metadata.docutils_support = False missing, warnings = metadata.check() self.assertEqual(missing, ['Author'])
def test_check_predicates(self): metadata = Metadata() metadata['Version'] = 'rr' metadata['Name'] = 'vimpdb' metadata['Home-page'] = 'http://pypi.python.org' metadata['Author'] = 'Monty Python' metadata['Requires-dist'] = ['Foo (a)'] metadata['Obsoletes-dist'] = ['Foo (a)'] metadata['Provides-dist'] = ['Foo (a)'] missing, warnings = metadata.check() self.assertEqual(len(warnings), 4)