def __str__(self): return tk.postfix(self) if self.period else self.root
def __str__(self): return '%s %s' % (tk.postfix(self), getattr(self, 'profile', ''))
def test_postfix(self): self.assertEqual(tk.postfix(self.form(2015)), 'FORM15')
def tk_postfix(title, arg='single'): return tk.postfix(title, type=arg)
def test_invalid_type(self): with self.assertRaisesRegex( ValueError, "'somestring' is not a valid type-parameter"): tk.postfix(("CERM", 2001), type="somestring")
def test_postfix(self): with tk.set_gfyear(2015): self.assertEqual(tk.postfix(('CERM', 2014)), 'CERM14')
def test_EFUIT(self, l): self.assertEqual(tk.postfix(("EFUIT", 2016)), "EFUIT16") l.check( ('tktitler', 'WARNING', 'Returning an EFUIT postfix. The postfix ' 'does not necessarily represent the actual year the given EFUIT ' 'was EFUIT.'))
def test_old_title(self, l): self.assertEqual(tk.postfix(("BEST", 1957)), "BEST57") l.check( ('tktitler', 'WARNING', 'Returning a postfix from before 1959. ' 'The postfix does not necessarily represent the actual year the ' 'given BEST was BEST.'))
def test_empty_longslash(self): self.assertEqual(tk.postfix(("", 2016), type='longslash'), "2016/17")
def test_longslash(self): self.assertEqual(tk.postfix(("CERM", 2016), type='longslash'), "CERM 2016/17")
def test_double(self): self.assertEqual(tk.postfix(("CERM", 2016), type='double'), "CERM1617")
def test_explicit_type(self): self.assertEqual(tk.postfix(("CERM", 2016), type='single'), "CERM16")
def test_notype(self): self.assertEqual(tk.postfix(("CERM", 2016)), "CERM16")