Beispiel #1
0
 def test_mem_rss(self, humanbytes, ps):
     ret = debug.mem_rss()
     ps.assert_called_with()
     ps().get_memory_info.assert_called_with()
     humanbytes.assert_called_with(ps().get_memory_info().rss)
     self.assertIs(ret, humanbytes())
     ps.return_value = None
     self.assertIsNone(debug.mem_rss())
Beispiel #2
0
 def test_mem_rss(self, humanbytes, ps):
     ret = debug.mem_rss()
     ps.assert_called_with()
     ps().get_memory_info.assert_called_with()
     humanbytes.assert_called_with(ps().get_memory_info().rss)
     self.assertIs(ret, humanbytes())
     ps.return_value = None
     self.assertIsNone(debug.mem_rss())
Beispiel #3
0
def test_mem_rss(patching):
    humanbytes = patching('celery.utils.debug.humanbytes')
    ps = patching('celery.utils.debug.ps')
    ret = debug.mem_rss()
    ps.assert_called_with()
    ps().memory_info.assert_called_with()
    humanbytes.assert_called_with(ps().memory_info().rss)
    assert ret is humanbytes()
    ps.return_value = None
    assert debug.mem_rss() is None
Beispiel #4
0
def test_mem_rss(patching):
    humanbytes = patching('celery.utils.debug.humanbytes')
    ps = patching('celery.utils.debug.ps')
    ret = debug.mem_rss()
    ps.assert_called_with()
    ps().memory_info.assert_called_with()
    humanbytes.assert_called_with(ps().memory_info().rss)
    assert ret is humanbytes()
    ps.return_value = None
    assert debug.mem_rss() is None