# Path: pythoscope/astbuilder.py
# def regenerate(tree):
#     """AST -> String
# 
#     Regenerate the source code from the AST tree.
#     """
#     if hasattr(tree, 'added_newline') and tree.added_newline:
#         return str(tree)[:-1]
#     else:
#         return str(tree)
# 
# Path: pythoscope/store.py
# def code_of(obj, reference=None):
#     """Return an AST for the given object.
# 
#     It is "code_of(obj)" instead of "obj.code" mostly for explicitness. Objects
#     have code attribute when they are created, but lose it once they are added
#     to a Module (see docstring for ObjectInModule). Existence of code_of
#     decouples a storage method (including caching) from an interface.
#     """
#     if reference is not None:
#         assert isinstance(obj, Module)
#     else:
#         reference = obj
#     return CodeTree.of(obj).get_code_of(reference)
# 
# Path: pythoscope/util.py
# def get_names(objects):
#     return map(lambda c: c.name, objects)


import sys
from nose import SkipTest
from pythoscope.inspector.static import inspect_code
from pythoscope.astbuilder import regenerate
from pythoscope.store import code_of
from pythoscope.util import get_names
from assertions import *
from helper import EmptyProject





new_style_class = """
class AClass(object):
    def amethod(self):
        pass
"""

old_style_class = """
class OldStyleClass:
    def amethod(self):
        pass
"""

class_without_methods = """
class ClassWithoutMethods(object):

# Path: pythoscope/astbuilder.py
# def regenerate(tree):
#     """AST -> String
# 
#     Regenerate the source code from the AST tree.
#     """
#     if hasattr(tree, 'added_newline') and tree.added_newline:
#         return str(tree)[:-1]
#     else:
#         return str(tree)
# 
# Path: pythoscope/store.py
# def code_of(obj, reference=None):
#     """Return an AST for the given object.
# 
#     It is "code_of(obj)" instead of "obj.code" mostly for explicitness. Objects
#     have code attribute when they are created, but lose it once they are added
#     to a Module (see docstring for ObjectInModule). Existence of code_of
#     decouples a storage method (including caching) from an interface.
#     """
#     if reference is not None:
#         assert isinstance(obj, Module)
#     else:
#         reference = obj
#     return CodeTree.of(obj).get_code_of(reference)
# 
# Path: pythoscope/util.py
# def get_names(objects):
#     return map(lambda c: c.name, objects)


# Path: test/test_static_inspector.py
import sys
from nose import SkipTest
from pythoscope.inspector.static import inspect_code
from pythoscope.astbuilder import regenerate
from pythoscope.store import code_of
from pythoscope.util import get_names
from assertions import *
from helper import EmptyProject






new_style_class = """
class AClass(object):
    def amethod(self):
        pass
"""

old_style_class = """
class OldStyleClass:
    def amethod(self):
        pass
"""

class_without_methods = """
class ClassWithoutMethods(object):

    pass