import sys, unittest
sys.path.append('..')
from SmallPackage.taskState import taskState


class test_taskState(unittest.TestCase):

    def test_update_and_retieval(self):
        state = taskState()
        data = {'mice': 10, 'men': 'blob', 'blob': {'10': 20}}
        blank_state, status = state.getState(None, 'data')
        self.assertEqual(blank_state, dict())
        state.update(data, 'data')
        new_state, status = state.getState()
        self.assertEqual(new_state, data)
        one_var, status = state.getState('men', 'data')
        self.assertEqual(data['men'], one_var)
        data, failed_status = state.getState('mmmmm')
        self.assertEqual(failed_status, -1)

    def test_Free(self):
        state = taskState()
        data = {'mice': 10}
        isFree = state.isFree('mice', 'data')
        self.assertEqual(isFree, True)
        state.update(data)
        isFree = state.isFree('mice', 'data')
        self.assertEqual(isFree, False)
        state.free('mice', 'data')
        isFree = state.isFree('mice', 'data')
        self.assertEqual(isFree, True)


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

5f04d668e071fda3f140c0b331e8d4f48a2dde24
<mask token>

<mask token>


class test_taskState(unittest.TestCase):

    def test_update_and_retieval(self):
        state = taskState()
        data = {'mice': 10, 'men': 'blob', 'blob': {'10': 20}}
        blank_state, status = state.getState(None, 'data')
        self.assertEqual(blank_state, dict())
        state.update(data, 'data')
        new_state, status = state.getState()
        self.assertEqual(new_state, data)
        one_var, status = state.getState('men', 'data')
        self.assertEqual(data['men'], one_var)
        data, failed_status = state.getState('mmmmm')
        self.assertEqual(failed_status, -1)

    def test_Free(self):
        state = taskState()
        data = {'mice': 10}
        isFree = state.isFree('mice', 'data')
        self.assertEqual(isFree, True)
        state.update(data)
        isFree = state.isFree('mice', 'data')
        self.assertEqual(isFree, False)
        state.free('mice', 'data')
        isFree = state.isFree('mice', 'data')
        self.assertEqual(isFree, True)


<mask token>

<mask token>
sys.path.append('..')
<mask token>


class test_taskState(unittest.TestCase):

    def test_update_and_retieval(self):
        state = taskState()
        data = {'mice': 10, 'men': 'blob', 'blob': {'10': 20}}
        blank_state, status = state.getState(None, 'data')
        self.assertEqual(blank_state, dict())
        state.update(data, 'data')
        new_state, status = state.getState()
        self.assertEqual(new_state, data)
        one_var, status = state.getState('men', 'data')
        self.assertEqual(data['men'], one_var)
        data, failed_status = state.getState('mmmmm')
        self.assertEqual(failed_status, -1)

    def test_Free(self):
        state = taskState()
        data = {'mice': 10}
        isFree = state.isFree('mice', 'data')
        self.assertEqual(isFree, True)
        state.update(data)
        isFree = state.isFree('mice', 'data')
        self.assertEqual(isFree, False)
        state.free('mice', 'data')
        isFree = state.isFree('mice', 'data')
        self.assertEqual(isFree, True)


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

import sys, unittest
sys.path.append('..')
from SmallPackage.taskState import taskState


class test_taskState(unittest.TestCase):

    def test_update_and_retieval(self):
        state = taskState()
        data = {'mice': 10, 'men': 'blob', 'blob': {'10': 20}}
        blank_state, status = state.getState(None, 'data')
        self.assertEqual(blank_state, dict())
        state.update(data, 'data')
        new_state, status = state.getState()
        self.assertEqual(new_state, data)
        one_var, status = state.getState('men', 'data')
        self.assertEqual(data['men'], one_var)
        data, failed_status = state.getState('mmmmm')
        self.assertEqual(failed_status, -1)

    def test_Free(self):
        state = taskState()
        data = {'mice': 10}
        isFree = state.isFree('mice', 'data')
        self.assertEqual(isFree, True)
        state.update(data)
        isFree = state.isFree('mice', 'data')
        self.assertEqual(isFree, False)
        state.free('mice', 'data')
        isFree = state.isFree('mice', 'data')
        self.assertEqual(isFree, True)


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