# Path: cpp/symbols.py
# class Error(BaseException):
# class Symbol(object):
# class SymbolTable(object):
#     def __init__(self, name, parts, namespace_stack):
#     def __init__(self):
#     def _lookup_namespace(self, symbol, namespace):
#     def _lookup_global(self, symbol):
#     def _lookup_in_all_namespaces(self, symbol):
#     def lookup_symbol(self, name, namespace_stack):
#     def _add(self, symbol_name, namespace, node, module):
#     def add_symbol(self, symbol_name, namespace_stack, node, module):
#     def get_namespace(self, name_seq):


import unittest
from cpp import symbols
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Symbol Table test."""

from __future__ import absolute_import




__author__ = 'nnorwitz@google.com (Neal Norwitz)'


class SymbolTableTest(unittest.TestCase):

    def _add_symbol(self, st, name, ns_stack):
        """Helper for the lookup_symbol test methods."""
        node = object()
        module = object()
        st.add_symbol(name, ns_stack, node, module)
        return node, module

    def test_lookup_symbol_with_global_that_does_not_exist(self):
        st = symbols.SymbolTable()

# Path: cpp/symbols.py
# class Error(BaseException):
# class Symbol(object):
# class SymbolTable(object):
#     def __init__(self, name, parts, namespace_stack):
#     def __init__(self):
#     def _lookup_namespace(self, symbol, namespace):
#     def _lookup_global(self, symbol):
#     def _lookup_in_all_namespaces(self, symbol):
#     def lookup_symbol(self, name, namespace_stack):
#     def _add(self, symbol_name, namespace, node, module):
#     def add_symbol(self, symbol_name, namespace_stack, node, module):
#     def get_namespace(self, name_seq):


# Path: test_symbols.py
import unittest
from cpp import symbols

#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Symbol Table test."""

from __future__ import absolute_import




__author__ = 'nnorwitz@google.com (Neal Norwitz)'


class SymbolTableTest(unittest.TestCase):

    def _add_symbol(self, st, name, ns_stack):
        """Helper for the lookup_symbol test methods."""
        node = object()
        module = object()
        st.add_symbol(name, ns_stack, node, module)
        return node, module

    def test_lookup_symbol_with_global_that_does_not_exist(self):
        st = symbols.SymbolTable()

        self.assertRaises(symbols.Error, st.lookup_symbol, 'foo', None)