コード例 #1
0
 def get_motd(self, filename):
     assert filename == 'testmotd'
     return c2h.Motd(raw=self.motd_text)
コード例 #2
0
 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 &lt;<span style="color: #cc0000">world</span>&gt;!</pre>'
     )
コード例 #3
0
 def test_read_no_file(self):
     motd = c2h.Motd('/no/such/file')
     self.assertEqual(motd.raw, '')
コード例 #4
0
 def test_as_html_empty(self):
     motd = c2h.Motd()
     self.assertEqual(motd.as_html(), '')
コード例 #5
0
 def test_read_file(self):
     motd = c2h.Motd(__file__)
     self.assertTrue(motd.raw)