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'))
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)
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)
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'));