class Controller(object): #deprecated def __init__(self): self.name = "Controller" self.updater = None def getUpdateView(self): if self.updater == None: self.updater = UpdateAdapter() return self.updater.generateHtmlView()
class Controller(object): #deprecated def __init__(self): self.name="Controller" self.updater=None def getUpdateView(self): if self.updater == None: self.updater = UpdateAdapter() return self.updater.generateHtmlView()
class TestHTMLPageGenerator(unittest.TestCase): def setUp(self): self.updateAdapter = UpdateAdapter() def test_update(self): message=self.updateAdapter.message() sysupdate=os.system('cat ../update_file') if sysupdate == 0: self.assertEqual(message, UPDATE_OK) elif sysupdate == 100: self.assertEqual(message, UPDATE) elif sysupdate == 1: self.assertEqual(message, UPDATE_ERROR) else: self.fail("Uknown code from yum") def test_update_view(self): self.assertTrue(len(self.updateAdapter.generateHtmlView()) > 0, "Take a look at the text")
def setUp(self): self.updateAdapter = UpdateAdapter()
def getUpdateView(self): if self.updater == None: self.updater = UpdateAdapter() return self.updater.generateHtmlView()