<s> import gc <EOL> import logging <EOL> import unittest <EOL> from nose . plugins . attrib import attr <EOL> import checks . system . win32 as w32 <EOL> logging . basicConfig ( level = logging . DEBUG ) <EOL> log = logging . getLogger ( __file__ ) <EOL> AGENT_CONFIG = { } <EOL> @ attr ( requires = '<STR_LIT>' ) <EOL> class TestWin32 ( unittest . TestCase ) : <EOL> def _checkMemoryLeak ( self , func ) : <EOL> gc . set_debug ( gc . DEBUG_LEAK ) <EOL> try : <EOL> start = len ( gc . garbage ) <EOL> func ( ) <EOL> end = len ( gc . garbage ) <EOL> self . assertEquals ( end - start , <NUM_LIT:0> , gc . garbage ) <EOL> finally : <EOL> gc . set_debug ( <NUM_LIT:0> ) <EOL> def testDisk ( self ) : <EOL> dsk = w32 . Disk ( log ) <EOL> self . _checkMemoryLeak ( lambda : dsk . check ( AGENT_CONFIG ) ) <EOL> def testIO ( self ) : <EOL> io = w32 . IO ( log ) <EOL> self . _checkMemoryLeak ( lambda : io . check ( AGENT_CONFIG ) ) <EOL> def testProcesses ( self ) : <EOL> proc = w32 . Processes ( log ) <EOL> self . _checkMemoryLeak ( lambda : proc . check ( AGENT_CONFIG ) ) <EOL> def testMemory ( self ) : <EOL> mem = w32 . Memory ( log ) <EOL> self . _checkMemoryLeak ( lambda : mem . check ( AGENT_CONFIG ) ) <EOL> def testNetwork ( self ) : <EOL> net = w32 . Network ( log ) <EOL> self . _checkMemoryLeak ( lambda : net . check ( AGENT_CONFIG ) ) <EOL> def testCPU ( self ) : <EOL> cpu = w32 . Cpu ( log ) <EOL> self . _checkMemoryLeak ( lambda : cpu . check ( AGENT_CONFIG ) ) </s>
