def place(self, val): red, stupac = self.selected if self.celije[red][stupac].value == 0: self.celije[red][stupac].set(val) self.update_model() if valid(self.model, val, (red, stupac)) and check(self.model): return True else: self.celije[red][stupac].set(0) self.celije[red][stupac].set_temp(0) self.update_model() return False
def test_valid_unmatch_tag(self): document = '<div>hoge</p></div>' result = checker.valid(document) self.assertFalse(result.status) self.assertTrue(result.reason, "FOUND_UN_MATCH_TAG")
def test_valid_not_found_open_tag(self): document = '</div>hoge</div>' result = checker.valid(document) self.assertFalse(result.status) self.assertTrue(result.reason, "NOT_FOUND_OPEN_TAG")
def test_valid_not_found_close_tag(self): document = '<a href="#">test' result = checker.valid(document) self.assertFalse(result.status) self.assertTrue(result.reason, "NOT_FOUND_CLOSE_TAG")
def test_valid2(self): document = '<div><a href="#">test</a><p>aaa</p></div>' self.assertTrue(checker.valid(document).status)
def test_valid(self): document = '<a href="#">test</a>' self.assertTrue(checker.valid(document).status)
def test_img_tag(self): document = "<p><a href='help.html'><img src='images/icon_help.png' alt=''>ヘルプ</a></p>" result = checker.valid(document) self.assertTrue(result.status)
def test_br_tag(self): document = '<br><br><br />' result = checker.valid(document) self.assertTrue(result.status)