コード例 #1
0
 def test_should_open_the_browser(self, mock_open, browser_open):
     import os
     ext = LizardExtension()
     ext.result = {'a': 123}
     ext.print_result()
     browser_open.assert_called_with('file://' +
                                     os.path.abspath('codecloud.html'))
コード例 #2
0
 def test_should_output_html(self, mock_open, browser_open):
     buf = ""
     mock_open.return_value.__enter__.return_value.write.side_effect = self.write_to_buffer
     ext = LizardExtension()
     ext.result = {'a':123}
     ext.print_result()
     mock_open.assert_called_once_with('codecloud.html', 'w')
     self.assertIn('<html>', self.buf)
     self.assertIn('["a", 123]', self.buf)
コード例 #3
0
 def test_should_output_html(self, mock_open, browser_open):
     buf = ""
     mock_open.return_value.__enter__.return_value.write.side_effect = self.write_to_buffer
     ext = LizardExtension()
     ext.result = {'a': 123}
     ext.print_result()
     mock_open.assert_called_once_with('codecloud.html', 'w')
     self.assertIn('<html>', self.buf)
     self.assertIn('["a", 123]', self.buf)
コード例 #4
0
 def test_should_open_the_browser(self, mock_open, browser_open):
     import os
     ext = LizardExtension()
     ext.result = {'a':123}
     ext.print_result()
     browser_open.assert_called_with('file://' + os.path.abspath('codecloud.html'));