Esempio n. 1
0
 def assertInsane(self, buf, *versions):
     try:
         sanity_check(buf)
     except Insane as e:
         for version in versions:
             # poor man's assertIn for compatibility with python < 2.7
             if version not in e.message:
                 msg = '%s not found in %s' % (version, e.message)
                 self.fail(msg)
         return
     else:
         raise self.failureException, "Insane not raised"
Esempio n. 2
0
 def test_comments_ignored(self):
     buf = self._make_buf('[versions]',
                          '#foo',
                          '#foo = 1.1',
                          'foo = 1.3')
     sanity_check(buf)
Esempio n. 3
0
 def test_package_with_underlines(self):
     buf = self._make_buf('[versions]',
                          'foo_bar = 1.1',
                          'qux_bar = 1.3')
     sanity_check(buf)
Esempio n. 4
0
 def test_package_with_dashes(self):
     buf = self._make_buf('[versions]',
                          'foo-bar = 1.1',
                          'qux-bar = 1.3')
     sanity_check(buf)