Пример #1
0
    def test_None_to_json(self):
        filename = self.temp_text()

        write_json(filename, None)

        actual = read_json(filename)
        self.assertIsNone(actual)
Пример #2
0
    def test_write_file(self):
        filename = self.temp_text()

        obj = Klass("value", 345)
        write_json(filename, obj)

        actual = read_json(filename)
        self.assertEquals("value", actual.member1)
        self.assertEquals(345, actual.member2)
Пример #3
0
 def save(self, items):
     convertible.write_json(self.filename, items)
Пример #4
0
 def save(self, items):
     convertible.write_json(self.filename, items)
Пример #5
0
 def save(self, obj):
     self.logger.info('saving config={0}'.format(self.filename))
     convertible.write_json(self.filename, obj)