示例#1
0
def run_autodoc(_):
    import synapse.tools.autodoc as s_autodoc
    s_autodoc.main(['--doc-model', '--savefile', 'synapse/datamodel.rst'])

    import synapse
    import subprocess
    abssynf = os.path.abspath(synapse.__file__)
    synbd = os.path.split(abssynf)[0]  # Split off __init__
    synpd = os.path.split(synbd)[0]  # split off the synapse module directory
    args = [
        'python', '-m', 'synapse.tools.autodoc', '--configable-opts',
        '--savefile', 'docs/synapse/configables.rst'
    ]
    subprocess.check_call(args, cwd=synpd)
示例#2
0
    def test_tools_autodoc(self):

        with self.getTestDir() as path:

            save = os.path.join(path, 'model.rst')
            outp = self.getTestOutp()
            argv = ['--doc-model', '--savefile', save]
            self.eq(s_autodoc.main(argv, outp=outp), 0)
示例#3
0
    def test_tools_autodoc_configable(self):
        with self.getTestDir() as path:

            save = os.path.join(path, 'configables.rst')
            outp = self.getTestOutp()
            argv = ['--configable-opts', '--savefile', save]
            self.eq(s_autodoc.main(argv, outp=outp), 0)

            with open(save, 'rb') as fd:
                rst = fd.read().decode()

            self.true('Synapse Configable Classes' in rst)
示例#4
0
    def test_tools_autodoc(self):

        with self.getTestDir() as path:

            save = os.path.join(path, 'model.rst')
            outp = self.getTestOutp()
            argv = ['--doc-model', '--savefile', save]
            self.eq(s_autodoc.main(argv, outp=outp), 0)

            with open(save, 'rb') as fd:
                rst = fd.read().decode()

            self.true('inet:ipv4:asn = <inet:asn> (default: -1)' in rst)
示例#5
0
    def test_tools_autodoc_configable(self):
        with self.getTestDir() as path:

            save = os.path.join(path, 'configables.rst')
            outp = self.getTestOutp()
            argv = ['--configable-opts', '--savefile', save]
            self.eq(s_autodoc.main(argv, outp=outp), 0)

            with open(save, 'rb') as fd:
                rst = fd.read().decode()

            self.true('Synapse Configable Classes' in rst)
            # Some cell configs which are comming in from @staticmethod and initConfDefs()
            self.true('axon:mapsize' in rst)
            self.true('The TCP port the Cell binds to (defaults to dynamic)' in rst)
            self.true('The TCP port the Neuron binds to' in rst)
示例#6
0
def run_autodoc(_):
    import synapse.tools.autodoc as s_autodoc
    s_autodoc.main(['--doc-model','--savefile','synapse/datamodel.rst'])
示例#7
0
def run_autodoc(_):
    import synapse.tools.autodoc as s_autodoc
    s_autodoc.main(['--doc-model', '--savefile', 'synapse/datamodel.rst'])
    s_autodoc.main(['--configable-opts', '--savefile', 'synapse/configables.rst'])