def test_label_dict_mutations_are_not_stored(self): jar = LabelJar(self.root) label_id = jar.add('Question', '#FF0000') label = jar.get(label_id) label['title'] = 'HACK THE TITLE' self.assertDictEqual({'label_id': label_id, 'title': 'Question', 'color': '#FF0000'}, jar.get(label_id))
def test_label_dict_mutations_are_not_stored(self): jar = LabelJar(self.root) label_id = jar.add('Question', '#FF0000', False) label = jar.get(label_id) label['title'] = 'HACK THE TITLE' self.assertDictEqual( { 'label_id': label_id, 'title': 'Question', 'color': '#FF0000', 'by_user': False }, jar.get(label_id))
def test_updating_labels(self): jar = LabelJar(self.root) label_id = jar.add('Question', '#FF0000') self.assertDictEqual({'label_id': label_id, 'title': 'Question', 'color': '#FF0000'}, jar.get(label_id)) jar.update(label_id, 'New Question', '#0000FF') self.assertDictEqual({'label_id': label_id, 'title': 'New Question', 'color': '#0000FF'}, jar.get(label_id))
def test_adding_new_label(self): jar = LabelJar(self.root) label_id = jar.add('Question', '#FF0000') self.assertDictEqual({'label_id': label_id, 'title': 'Question', 'color': '#FF0000'}, jar.get(label_id))
def test_updating_labels(self): jar = LabelJar(self.root) label_id = jar.add('Question', '#FF0000', False) self.assertDictEqual( { 'label_id': label_id, 'title': 'Question', 'color': '#FF0000', 'by_user': False }, jar.get(label_id)) jar.update(label_id, 'New Question', '#0000FF', True) self.assertDictEqual( { 'label_id': label_id, 'title': 'New Question', 'color': '#0000FF', 'by_user': True }, jar.get(label_id))
def test_adding_new_label(self): jar = LabelJar(self.root) label_id = jar.add('Question', '#FF0000', False) self.assertDictEqual( { 'label_id': label_id, 'title': 'Question', 'color': '#FF0000', 'by_user': False }, jar.get(label_id))