Exemplo n.º 1
0
 def test_smart_truncate_new_suffix(self):
     """Test smart_truncate utility function with a defined suffix
     """
     s = """Cosby sweater iphone artisan, squid trust fund photo booth twee
         shoreditch single-origin coffee aesthetic jean shorts messenger bag
         brooklyn butcher. Iphone fap banksy next level put a bird on it,
         letterpress photo booth thundercats biodiesel fanny pack."""
     trunc = smart_truncate(content=s, suffix='...MORE')
     self.assertTrue(trunc.endswith('...MORE'), s)
Exemplo n.º 2
0
 def test_smart_truncate_long(self):
     """Test smart_truncate utility function with a long string
     """
     s = """Cosby sweater iphone artisan, squid trust fund photo booth twee
         shoreditch single-origin coffee aesthetic jean shorts messenger bag
         brooklyn butcher. Iphone fap banksy next level put a bird on it,
         letterpress photo booth thundercats biodiesel fanny pack."""
     trunc = smart_truncate(s)
     self.assertTrue(trunc.endswith('(more)'), s)
Exemplo n.º 3
0
 def test_smart_truncate_new_suffix(self):
     """Test smart_truncate utility function with a defined suffix
     """
     s = """Cosby sweater iphone artisan, squid trust fund photo booth twee
         shoreditch single-origin coffee aesthetic jean shorts messenger bag
         brooklyn butcher. Iphone fap banksy next level put a bird on it,
         letterpress photo booth thundercats biodiesel fanny pack."""
     trunc = smart_truncate(content=s, suffix='...MORE')
     self.assertTrue(trunc.endswith('...MORE'), s)
Exemplo n.º 4
0
 def test_smart_truncate_long(self):
     """Test smart_truncate utility function with a long string
     """
     s = """Cosby sweater iphone artisan, squid trust fund photo booth twee
         shoreditch single-origin coffee aesthetic jean shorts messenger bag
         brooklyn butcher. Iphone fap banksy next level put a bird on it,
         letterpress photo booth thundercats biodiesel fanny pack."""
     trunc = smart_truncate(s)
     self.assertTrue(trunc.endswith('(more)'), s)
Exemplo n.º 5
0
 def test_smart_truncate_short(self):
     """Test smart_truncate utility function with a short string
     """
     s = 'Quinoa cred brooklyn, sartorial letterpress.'
     trunc = smart_truncate(s)
     self.assertTrue(trunc.endswith('letterpress.'))
Exemplo n.º 6
0
 def test_smart_truncate_short(self):
     """Test smart_truncate utility function with a short string
     """
     s = 'Quinoa cred brooklyn, sartorial letterpress.'
     trunc = smart_truncate(s)
     self.assertTrue(trunc.endswith('letterpress.'))