mirror of
https://github.com/fergalmoran/picard.git
synced 2026-02-18 21:53:58 +00:00
PICARD-1719: Fix $unset must not mark tags for deletion.
This regressed in Picard 2.2.0 with commit 503b520 and $unset behaves the same as $delete.
This commit is contained in:
@@ -69,7 +69,9 @@ class ScriptParserTest(PicardTestCase):
|
||||
self.assertScriptResultEquals("$right(abcd,x)", "")
|
||||
|
||||
def test_cmd_set(self):
|
||||
self.assertScriptResultEquals("$set(test,aaa)%test%", "aaa")
|
||||
context = Metadata()
|
||||
self.assertScriptResultEquals("$set(test,aaa)%test%", "aaa", context)
|
||||
self.assertEqual(context['test'], 'aaa')
|
||||
|
||||
def test_cmd_set_empty(self):
|
||||
self.assertScriptResultEquals("$set(test,)%test%", "")
|
||||
@@ -464,6 +466,13 @@ class ScriptParserTest(PicardTestCase):
|
||||
self.assertNotIn('performer:bar', context)
|
||||
self.assertNotIn('performer:foo', context)
|
||||
|
||||
def test_cmd_unset(self):
|
||||
context = Metadata()
|
||||
context['title'] = 'Foo'
|
||||
self.parser.eval("$unset(title)", context)
|
||||
self.assertNotIn('title', context)
|
||||
self.assertNotIn('title', context.deleted_tags)
|
||||
|
||||
def test_cmd_delete(self):
|
||||
context = Metadata()
|
||||
context['title'] = 'Foo'
|
||||
|
||||
Reference in New Issue
Block a user