Exemple #1
0
    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))
Exemple #2
0
    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))