How to use the titlecase.TitlecaseTests function in titlecase

To help you get started, we’ve selected a few titlecase examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github censusreporter / census-table-metadata / titlecase.py View on Github external
text = titlecase(
            'generalissimo francisco franco: still dead; kieren McCarthy: '\
                'still a jackass'
        )
        result = 'Generalissimo Francisco Franco: Still Dead; Kieren '\
            'McCarthy: Still a Jackass'
        self.assertEqual(text, result, "%s should be: %s" % (text, result, ))


if __name__ == '__main__':
    if not sys.stdin.isatty():
        for line in sys.stdin:
            print(titlecase(line))

    else:
        suite = unittest.TestLoader().loadTestsFromTestCase(TitlecaseTests)
        unittest.TextTestRunner(verbosity=2).run(suite)