How to use normality - 10 common examples

To help you get started, we’ve selected a few normality 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 pudo / normality / tests / test_normality.py View on Github external
def test_empty(self):
        self.assertEqual(None, slugify(None))
        self.assertEqual(None, ascii_text(None))
        self.assertEqual(None, latinize_text(None))
        self.assertEqual(None, normalize(None))
        self.assertEqual(None, normalize(''))
        self.assertEqual(None, normalize(' '))
github pudo / normality / tests / test_normality.py View on Github external
def test_ahmad(self):
        text = u'əhməd'
        self.assertEqual('ahmad', ascii_text(text))
github pudo / normality / tests / test_normality.py View on Github external
def test_empty(self):
        self.assertEqual(None, slugify(None))
        self.assertEqual(None, ascii_text(None))
        self.assertEqual(None, latinize_text(None))
        self.assertEqual(None, normalize(None))
        self.assertEqual(None, normalize(''))
        self.assertEqual(None, normalize(' '))
github pudo / normality / tests / test_normality.py View on Github external
def test_azeri(self):
        text = u'FUAD ALIYEV ƏHMƏD OĞLU'
        self.assertEqual('FUAD ALIYEV AHMAD OGLU', ascii_text(text))
github pudo / normality / tests / test_paths.py View on Github external
def test_safe_filename(self):
        self.assertEqual(None, safe_filename(None))
        self.assertEqual('test.txt', safe_filename('test.txt'))
        self.assertEqual('test.txt', safe_filename('test .txt'))
        self.assertEqual('test_bla.txt', safe_filename('test bla.txt'))
        self.assertEqual('test_bla.txt', safe_filename('test_bla.txt'))
        self.assertEqual('test_bla.txt', safe_filename('test.bla.txt'))
        self.assertEqual('test.txt', safe_filename('test', extension='txt'))
github pudo / normality / tests / test_paths.py View on Github external
def test_safe_filename(self):
        self.assertEqual(None, safe_filename(None))
        self.assertEqual('test.txt', safe_filename('test.txt'))
        self.assertEqual('test.txt', safe_filename('test .txt'))
        self.assertEqual('test_bla.txt', safe_filename('test bla.txt'))
        self.assertEqual('test_bla.txt', safe_filename('test_bla.txt'))
        self.assertEqual('test_bla.txt', safe_filename('test.bla.txt'))
        self.assertEqual('test.txt', safe_filename('test', extension='txt'))
github pudo / normality / tests / test_paths.py View on Github external
def test_long_filename(self):
        long_name = ['long name'] * 100
        long_name = '-'.join(long_name)

        shortened = safe_filename(long_name)
        assert len(shortened) <= MAX_LENGTH, shortened

        shortened = safe_filename(long_name, extension='html')
        assert len(shortened) <= MAX_LENGTH, shortened

        shortened = safe_filename('bla', extension=long_name)
        assert len(shortened) <= MAX_LENGTH, shortened

        shortened = safe_filename(long_name, extension=long_name)
        assert len(shortened) <= MAX_LENGTH, shortened
github pudo / normality / tests / test_paths.py View on Github external
def test_safe_filename(self):
        self.assertEqual(None, safe_filename(None))
        self.assertEqual('test.txt', safe_filename('test.txt'))
        self.assertEqual('test.txt', safe_filename('test .txt'))
        self.assertEqual('test_bla.txt', safe_filename('test bla.txt'))
        self.assertEqual('test_bla.txt', safe_filename('test_bla.txt'))
        self.assertEqual('test_bla.txt', safe_filename('test.bla.txt'))
        self.assertEqual('test.txt', safe_filename('test', extension='txt'))
github pudo / normality / tests / test_paths.py View on Github external
def test_long_filename(self):
        long_name = ['long name'] * 100
        long_name = '-'.join(long_name)

        shortened = safe_filename(long_name)
        assert len(shortened) <= MAX_LENGTH, shortened

        shortened = safe_filename(long_name, extension='html')
        assert len(shortened) <= MAX_LENGTH, shortened

        shortened = safe_filename('bla', extension=long_name)
        assert len(shortened) <= MAX_LENGTH, shortened

        shortened = safe_filename(long_name, extension=long_name)
        assert len(shortened) <= MAX_LENGTH, shortened
github pudo / normality / tests / test_paths.py View on Github external
def test_safe_filename(self):
        self.assertEqual(None, safe_filename(None))
        self.assertEqual('test.txt', safe_filename('test.txt'))
        self.assertEqual('test.txt', safe_filename('test .txt'))
        self.assertEqual('test_bla.txt', safe_filename('test bla.txt'))
        self.assertEqual('test_bla.txt', safe_filename('test_bla.txt'))
        self.assertEqual('test_bla.txt', safe_filename('test.bla.txt'))
        self.assertEqual('test.txt', safe_filename('test', extension='txt'))