def get_motd(self, filename): assert filename == 'testmotd' return c2h.Motd(raw=self.motd_text)
def test_as_html_nonempty(self): motd = c2h.Motd(raw='Hello <\033[31mworld\033[0m>!\n') self.assertEqual( motd.as_html(), '<pre class="motd">Hello <<span style="color: #cc0000">world</span>>!</pre>' )
def test_read_no_file(self): motd = c2h.Motd('/no/such/file') self.assertEqual(motd.raw, '')
def test_as_html_empty(self): motd = c2h.Motd() self.assertEqual(motd.as_html(), '')
def test_read_file(self): motd = c2h.Motd(__file__) self.assertTrue(motd.raw)