import unittest
from enum import Enum
from tree_inspector.tree_builder import TreeBuilder


class Dummy(Enum):
    A = 1
    B = 2


class TestPrimitiveTypes(unittest.TestCase):

    def check_node(self, x):
        node = TreeBuilder().node('var', x)
        self.assertEqual(node.short_type, x.__class__.__name__)
        self.assertEqual(len(node.children), 0)
        self.assertEqual(node.value, str(x))
        print(node)

    def test_multiple(self):
        self.check_node(18)
        self.check_node(1.23456)
        self.check_node('Some arbitrary string')
        self.check_node(b'a byte string')
        self.check_node(True)
        self.check_node(None)
        self.check_node(u'shelsl')
        self.check_node(Dummy.A)
        self.check_node(complex('1+2j'))


if __name__ == '__main__':
    unittest.main()

cbd96ce03c1b873c1261e326e3e4d0cffed23e1b
<mask token>


class TestPrimitiveTypes(unittest.TestCase):
    <mask token>

    def test_multiple(self):
        self.check_node(18)
        self.check_node(1.23456)
        self.check_node('Some arbitrary string')
        self.check_node(b'a byte string')
        self.check_node(True)
        self.check_node(None)
        self.check_node(u'shelsl')
        self.check_node(Dummy.A)
        self.check_node(complex('1+2j'))


<mask token>

<mask token>


class Dummy(Enum):
    A = 1
    B = 2


class TestPrimitiveTypes(unittest.TestCase):

    def check_node(self, x):
        node = TreeBuilder().node('var', x)
        self.assertEqual(node.short_type, x.__class__.__name__)
        self.assertEqual(len(node.children), 0)
        self.assertEqual(node.value, str(x))
        print(node)

    def test_multiple(self):
        self.check_node(18)
        self.check_node(1.23456)
        self.check_node('Some arbitrary string')
        self.check_node(b'a byte string')
        self.check_node(True)
        self.check_node(None)
        self.check_node(u'shelsl')
        self.check_node(Dummy.A)
        self.check_node(complex('1+2j'))


<mask token>

<mask token>


class Dummy(Enum):
    A = 1
    B = 2


class TestPrimitiveTypes(unittest.TestCase):

    def check_node(self, x):
        node = TreeBuilder().node('var', x)
        self.assertEqual(node.short_type, x.__class__.__name__)
        self.assertEqual(len(node.children), 0)
        self.assertEqual(node.value, str(x))
        print(node)

    def test_multiple(self):
        self.check_node(18)
        self.check_node(1.23456)
        self.check_node('Some arbitrary string')
        self.check_node(b'a byte string')
        self.check_node(True)
        self.check_node(None)
        self.check_node(u'shelsl')
        self.check_node(Dummy.A)
        self.check_node(complex('1+2j'))


if __name__ == '__main__':
    unittest.main()

import unittest
from enum import Enum
from tree_inspector.tree_builder import TreeBuilder


class Dummy(Enum):
    A = 1
    B = 2


class TestPrimitiveTypes(unittest.TestCase):

    def check_node(self, x):
        node = TreeBuilder().node('var', x)
        self.assertEqual(node.short_type, x.__class__.__name__)
        self.assertEqual(len(node.children), 0)
        self.assertEqual(node.value, str(x))
        print(node)

    def test_multiple(self):
        self.check_node(18)
        self.check_node(1.23456)
        self.check_node('Some arbitrary string')
        self.check_node(b'a byte string')
        self.check_node(True)
        self.check_node(None)
        self.check_node(u'shelsl')
        self.check_node(Dummy.A)
        self.check_node(complex('1+2j'))


if __name__ == '__main__':
    unittest.main()
