Exemplo n.º 1
0
 def test_heap_dump_tmp(self):
     settings = Settings({"heap_dump": "tmp"})
     strategy = PercentStrategy("blitz", settings)
     hd = strategy.get_heap_dump()
     append = strategy.get_append()
     assert " " not in hd
     assert "HeapDumpPath" not in hd
     assert "HeapDumpPath" in "".join(append)
Exemplo n.º 2
0
 def test_heap_dump_on(self):
     settings = Settings({"heap_dump": "on"})
     strategy = PercentStrategy("blitz", settings)
     hd = strategy.get_heap_dump()
     append = strategy.get_append()
     assert " " not in hd
     assert "HeapDumpPath" not in hd
     assert not append
Exemplo n.º 3
0
 def test_heap_dump_tmp(self):
     settings = Settings({"heap_dump": "tmp"})
     strategy = PercentStrategy("blitz", settings)
     hd = strategy.get_heap_dump()
     append = strategy.get_append()
     assert " " not in hd
     assert "HeapDumpPath" not in hd
     assert "HeapDumpPath" in "".join(append)
Exemplo n.º 4
0
 def test_heap_dump_on(self):
     settings = Settings({"heap_dump": "on"})
     strategy = PercentStrategy("blitz", settings)
     hd = strategy.get_heap_dump()
     append = strategy.get_append()
     assert " " not in hd
     assert "HeapDumpPath" not in hd
     assert not append
Exemplo n.º 5
0
 def test_percent_usage(self):
     strategy = PercentStrategy("blitz")
     table = list(strategy.usage_table(15, 16))[0]
     assert table[0] == 2**15
     assert table[1] == int(2**15 * 15 / 100)
Exemplo n.º 6
0
 def test_percent_usage(self):
     strategy = PercentStrategy("blitz")
     table = list(strategy.usage_table(15, 16))[0]
     assert table[0] == 2 ** 15
     assert table[1] == 2 ** 15 * 15 / 100