# Path: deepstreampy/jsonpath.py
# SPLIT_REG_EXP = r"[\.\[\]]"
# def get(data, path, deep_copy):
# def set(data, path, value, deep_copy):
# def _tokenize(path):
# def _pad_list(_list, index, value):


from deepstreampy import jsonpath
import unittest

    def setUp(self):
        self.test_data = {'firstname': 'John',
                          'lastname': 'Smith',
                          'address': {
                                      'street': 'currentStreet'
                                  },
                          'pastAddresses': [
                                    {'street': 'firststreet', 'postCode': 1001},
                                    {'street': 'secondstreet', 'postCode': 2002}
                                  ],
                          1234: 'integer index'}

    def test_simple_path(self):
        value = jsonpath.get(self.test_data, 'firstname', False)
        self.assertEquals(value, 'John')

        value = jsonpath.get(self.test_data, 'lastname', False)
        self.assertEquals(value, 'Smith')

    def test_nested_path(self):
        value = jsonpath.get(self.test_data, 'address.street', False)
        self.assertEquals(value, 'currentStreet')

    def test_other_array_entries(self):
        value = jsonpath.get(self.test_data, 'pastAddresses[0]', False)
        self.assertEquals(value,
                          {'street': 'firststreet', 'postCode': 1001})

    def test_array_entries(self):

# Path: deepstreampy/jsonpath.py
# SPLIT_REG_EXP = r"[\.\[\]]"
# def get(data, path, deep_copy):
# def set(data, path, value, deep_copy):
# def _tokenize(path):
# def _pad_list(_list, index, value):


# Path: tests/record_tests/test_jsonpath.py
from deepstreampy import jsonpath
import unittest


    def setUp(self):
        self.test_data = {'firstname': 'John',
                          'lastname': 'Smith',
                          'address': {
                                      'street': 'currentStreet'
                                  },
                          'pastAddresses': [
                                    {'street': 'firststreet', 'postCode': 1001},
                                    {'street': 'secondstreet', 'postCode': 2002}
                                  ],
                          1234: 'integer index'}

    def test_simple_path(self):
        value = jsonpath.get(self.test_data, 'firstname', False)
        self.assertEquals(value, 'John')

        value = jsonpath.get(self.test_data, 'lastname', False)
        self.assertEquals(value, 'Smith')

    def test_nested_path(self):
        value = jsonpath.get(self.test_data, 'address.street', False)
        self.assertEquals(value, 'currentStreet')

    def test_other_array_entries(self):
        value = jsonpath.get(self.test_data, 'pastAddresses[0]', False)
        self.assertEquals(value,
                          {'street': 'firststreet', 'postCode': 1001})

    def test_array_entries(self):

        value = jsonpath.get(self.test_data, 'pastAddresses[1]', False)