def test_get_filename_none_left(self):
     import solescion.utils.screenshot as screenshot_module
     orig = screenshot_module.listdir
     screenshot_module.listdir = \
         lambda *_: ["A%03d.png" % idx for idx in range(101)]
     try:
         self.assertNone(_get_filename("A", ".png"), "expected None")
     finally:
         screenshot_module.listdir = orig
 def test_get_filename(self):
     import solescion.utils.screenshot as screenshot_module
     orig = screenshot_module.listdir
     screenshot_module.listdir = lambda *_: ["A000.png"]
     try:
         self.assertEquals(
             _get_filename("A", ".png"),
             join(expanduser("~"), "A001.png"),
             "bad filename")
     finally:
         screenshot_module.listdir = orig