This repo contains code to mirror other repos. It also contains the code that is getting mirrored.
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

27 wiersze
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()