示例#1
0
    def test_loads_stores(self):
        """Test parser 'loads' and 'stores' methods"""
        moddict = ModDict()
        moddict.parse(inputs.TEST_MODULE_0)

        stores = moddict.stores()
        moddict2 = ModDict()
        moddict2.loads(stores)

        self.assertEqual(stores, moddict2.stores())
示例#2
0
    def test_parser_4(self):
        """Test parser with TEST_MODULE_4"""
        moddict = ModDict()
        moddict.parse(inputs.TEST_MODULE_4)
        stores = moddict.stores()

        self.assertEqual(eval(stores), TEST_MODULE_4_REF)
示例#3
0
 def test_parser_3(self):
     """Test parser with TEST_MODULE_3"""
     moddict = ModDict()
     moddict.parse(inputs.TEST_MODULE_3)
     stores = moddict.stores()
     print(stores)
     self.assertEqual(eval(stores), TEST_MODULE_3_REF)
示例#4
0
    def test_load_store(self):
        """Test parser 'load' and 'store' methods"""
        moddict = ModDict()
        moddict.parse(inputs.TEST_MODULE_0)

        filename = '__test_load_store.txt'

        moddict.store(filename)
        moddict2 = ModDict()
        moddict2.load(filename)

        self.assertEqual(eval(moddict2.stores()), TEST_MODULE_0_REF)

        os.remove(filename)