

def testJson(self):
    data = {
        'foo': ['bar', 'baz', 5],
        'qux': None,
    }
    v = registry.Json('foo', 'help')
    self.assertEqual(v(), 'foo')
    v.setValue(data)
    self.assertEqual(v(), data)
    self.assertIsNot(v(), data)
    with v.editable() as dict_:
        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.assertNotIn('qux', v())

dataset/ETHPy150Open ProgVal/Limnoria/test/test_registry.py ValuesTestCase.testJson/original