def _DoTest(self, value, expected): sess = mocks.FakeSession() sess.type = value self.failUnlessEqual(nxserver._GetSessionCache(sess), expected)
def testRender(self): sess = mocks.FakeSession() sess.fullscreen = False sess.screeninfo = "1024x768x32+render" sess.virtualdesktop = None self._DoTest(sess, "-R---PSA")
def testDesktop(self): sess = mocks.FakeSession() sess.fullscreen = False sess.screeninfo = None sess.virtualdesktop = True self._DoTest(sess, "--D--PSA")
def testFullscreen(self): sess = mocks.FakeSession() sess.fullscreen = True sess.screeninfo = None sess.virtualdesktop = None self._DoTest(sess, "F----PSA")