コード例 #1
0
ファイル: test_utils.py プロジェクト: ropable/prs
 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)
コード例 #2
0
ファイル: test_utils.py プロジェクト: ropable/prs
 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)
コード例 #3
0
ファイル: test_utils.py プロジェクト: parksandwildlife/prs
 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)
コード例 #4
0
ファイル: test_utils.py プロジェクト: parksandwildlife/prs
 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)
コード例 #5
0
ファイル: test_utils.py プロジェクト: ropable/prs
 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.'))
コード例 #6
0
ファイル: test_utils.py プロジェクト: parksandwildlife/prs
 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.'))