Exemplo n.º 1
0
    def test_meliae_dump_error(self):
        """Check the error case."""
        dump_all_objects = mock.Mock(side_effect=ValueError())
        self.patch(scanner, 'dump_all_objects', dump_all_objects)

        self.assertIn("Error while trying to dump memory", meliae_dump())

        dump_all_objects.assert_called_once_with(mock.ANY)
Exemplo n.º 2
0
    def test_meliae_dump_error(self):
        """Check the error case."""
        from meliae import scanner

        dump_all_objects = self.mocker.replace(scanner.dump_all_objects)
        dump_all_objects(ANY)
        self.mocker.throw(ValueError)
        self.mocker.replay()

        self.assertIn("Error while trying to dump memory", meliae_dump())
Exemplo n.º 3
0
    def test_meliae_dump(self):
        """Check that the dump works."""
        collect = mock.Mock()
        self.patch(gc, 'collect',  collect)
        dump_all_objects = mock.Mock()
        self.patch(scanner, 'dump_all_objects', dump_all_objects)

        self.assertIn("Output written to:", meliae_dump())

        collect.assert_called_once_with()
        dump_all_objects.assert_called_once_with(mock.ANY)
Exemplo n.º 4
0
    def test_meliae_dump(self):
        """Check that the dump works."""
        from meliae import scanner

        collect = self.mocker.replace(gc.collect)
        dump_all_objects = self.mocker.replace(scanner.dump_all_objects)

        collect()
        dump_all_objects(ANY)
        self.mocker.replay()

        self.assertIn("Output written to:", meliae_dump())
Exemplo n.º 5
0
 def render_GET(self, request):
     """Handle GET."""
     return dump.meliae_dump()
Exemplo n.º 6
0
 def render_GET(self, request):
     """Handle GET."""
     return dump.meliae_dump()