mirror of
https://github.com/progval/Limnoria.git
synced 2025-04-25 12:31:04 -05:00
registry.Json: Fix broken test due to returning the internal state directly
This commit is contained in:
parent
c795cdc655
commit
c81ff28697
@ -31,6 +31,7 @@
|
||||
|
||||
import re
|
||||
import os
|
||||
import copy
|
||||
import time
|
||||
import json
|
||||
import codecs
|
||||
@ -921,6 +922,8 @@ class TemplatedString(String):
|
||||
class Json(String):
|
||||
__slots__ = ()
|
||||
|
||||
def __call__(self):
|
||||
return copy.deepcopy(super(Json, self).__call__())
|
||||
def set(self, v):
|
||||
self.setValue(json.loads(v))
|
||||
def __str__(self):
|
||||
|
@ -140,13 +140,13 @@ class ValuesTestCase(SupyTestCase):
|
||||
self.assertIsNot(v(), data)
|
||||
|
||||
with v.editable() as dict_:
|
||||
dict_['supy'] = 'bot'
|
||||
dict_['supy'] = ['bot']
|
||||
del dict_['qux']
|
||||
self.assertNotIn('supy', v())
|
||||
self.assertIn('qux', v())
|
||||
self.assertIn('supy', v())
|
||||
self.assertEqual(v()['supy'], 'bot')
|
||||
self.assertIsNot(v()['supy'], 'bot')
|
||||
self.assertEqual(v()['supy'], ['bot'])
|
||||
self.assertIsNot(v()['supy'], ['bot'])
|
||||
self.assertNotIn('qux', v())
|
||||
|
||||
def testNormalizedString(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user