This repo contains code to mirror other repos. It also contains the code that is getting mirrored.
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 

27 řádky
536 B

  1. from __future__ import absolute_import
  2. import unittest
  3. from unittest import TestCase
  4. import copy
  5. import pickle
  6. from lark.tree import Tree
  7. class TestTrees(TestCase):
  8. def setUp(self):
  9. self.tree1 = Tree('a', [Tree(x, y) for x, y in zip('bcd', 'xyz')])
  10. def test_deepcopy(self):
  11. assert self.tree1 == copy.deepcopy(self.tree1)
  12. def test_pickle(self):
  13. s = copy.deepcopy(self.tree1)
  14. data = pickle.dumps(s)
  15. assert pickle.loads(data) == s
  16. if __name__ == '__main__':
  17. unittest.main()