Exemple #1
0
 def test_update_tag(self):
     context = Context()
     context.create_tag(1, 'python')
     context.update_tag(1, 'lua')
     tag = context.get_tag(1)
     self.assertEqual(tag.id, 1)
     self.assertEqual(tag.name, 'lua')
Exemple #2
0
 def test_unique_tag_name_on_update(self):
     context = Context()
     context.create_tag(1, 'python')
     context.create_tag(2, 'rust')
     with self.assertRaises(ValueError):
         context.update_tag(2, 'python')
Exemple #3
0
 def test_update_missing_tag(self):
     context = Context()
     context.create_tag(1, 'python')
     with self.assertRaises(ValueError):
         context.update_tag(2, 'lua')