# 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
        value = jsonpath.get(self.test_data, 'pastAddresses[3]', False)
        self.assertEqual(value, None)

    def test_negative_array_index(self):
        value = jsonpath.get(self.test_data, 'pastAddresses[-1]', False)
        self.assertEquals(value,
                          {'street': 'secondstreet', 'postCode': 2002})

    def test_detect_changes(self):
        value = jsonpath.get(self.test_data, 'firstname', False)
        self.assertEquals(value, 'John')
        self.test_data['firstname'] = 'Adam'
        value = jsonpath.get(self.test_data, 'firstname', False)
        self.assertEquals(value, 'Adam')

    def test_detect_changes_to_arrays(self):
        value = jsonpath.get(self.test_data, 'pastAddresses[1].street', False)
        self.assertEquals(value, 'secondstreet')
        self.test_data['pastAddresses'].pop()
        value = jsonpath.get(self.test_data, 'pastAddresses[1].street', False)
        self.assertEquals(value, None)


class TestSet(unittest.TestCase):

    def setUp(self):
        self.test_data = {}

    def test_simple_value(self):
        jsonpath.set(self.test_data, 'firstname', 'John', False)

# 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

        value = jsonpath.get(self.test_data, 'pastAddresses[3]', False)
        self.assertEqual(value, None)

    def test_negative_array_index(self):
        value = jsonpath.get(self.test_data, 'pastAddresses[-1]', False)
        self.assertEquals(value,
                          {'street': 'secondstreet', 'postCode': 2002})

    def test_detect_changes(self):
        value = jsonpath.get(self.test_data, 'firstname', False)
        self.assertEquals(value, 'John')
        self.test_data['firstname'] = 'Adam'
        value = jsonpath.get(self.test_data, 'firstname', False)
        self.assertEquals(value, 'Adam')

    def test_detect_changes_to_arrays(self):
        value = jsonpath.get(self.test_data, 'pastAddresses[1].street', False)
        self.assertEquals(value, 'secondstreet')
        self.test_data['pastAddresses'].pop()
        value = jsonpath.get(self.test_data, 'pastAddresses[1].street', False)
        self.assertEquals(value, None)


class TestSet(unittest.TestCase):

    def setUp(self):
        self.test_data = {}

    def test_simple_value(self):
        jsonpath.set(self.test_data, 'firstname', 'John', False)

        self.assertEqual(self.test_data, {'firstname': 'John'})