def __init__(self, wf): self.wf = wf if self.wf.update_available: wf.add_item('New version available', 'Action this item to install the update', autocomplete='workflow:update', icon=ICON_INFO) self.models = [ DateTime(), MD5(), Base64(), Html(), Javascript(), SHA(), Number(), ASCII(), TheUUID(), String(), IPAddr(), ] self.modelDict = dict() self.max_age = 60 * 60 * 24 * 365 for m in self.models: self.modelDict[m.name] = m
def test_number_range(self): converter = ASCII() self.assertEquals(0, len(converter.convert("31"))) self.assertEquals(1, len(converter.convert("32"))) self.assertEquals(1, len(converter.convert("126"))) self.assertEquals(0, len(converter.convert("127")))
def test_number_to_char(self): converter = ASCII() self.assertEquals('a', converter.convert("97")[0].subtitle)
def test_char_to_number(self): converter = ASCII() self.assertEquals('97', converter.convert("a")[0].subtitle)