Beispiel #1
0
    def test_class(self):
        """"""

        result = doc_parsing.container(ExposedStep)
        self.assertIsInstance(result, dict)
        self.assertIsInstance(result['functions'], list)
        self.assertGreaterEqual(len(result['functions']), 2)
Beispiel #2
0
    def test_class(self):
        """"""

        result = doc_parsing.container(ExposedStep)
        self.assertIsInstance(result, dict)
        self.assertIsInstance(result['functions'], list)
        self.assertGreaterEqual(len(result['functions']), 2)
Beispiel #3
0
    def test_parse_cauldron_module(self):
        """"""

        result = doc_parsing.container(cauldron)
        self.assertIsInstance(result, dict)
        self.assertEqual(result['name'], 'cauldron')
        self.assertIsInstance(result['functions'], list)
        self.assertGreaterEqual(len(result['functions']), 1)
Beispiel #4
0
    def test_parse_cauldron_module(self):
        """"""

        result = doc_parsing.container(cauldron)
        self.assertIsInstance(result, dict)
        self.assertEqual(result['name'], 'cauldron')
        self.assertIsInstance(result['functions'], list)
        self.assertGreaterEqual(len(result['functions']), 1)
Beispiel #5
0
    def test_class_with_props_and_returns(self):
        """"""

        result = doc_parsing.container(StepTestCase)
        self.assertIsInstance(result, dict)
        self.assertIsInstance(result['functions'], list)
        self.assertGreaterEqual(len(result['functions']), 2)
        self.assertIsInstance(result['variables'], list)
        self.assertGreaterEqual(len(result['variables']), 2)
Beispiel #6
0
    def test_class_with_props_and_returns(self):
        """"""

        result = doc_parsing.container(StepTestCase)
        self.assertIsInstance(result, dict)
        self.assertIsInstance(result['functions'], list)
        self.assertGreaterEqual(len(result['functions']), 2)
        self.assertIsInstance(result['variables'], list)
        self.assertGreaterEqual(len(result['variables']), 2)
Beispiel #7
0
def parse(target, output_folder):
    """
    Parses the target and places the results in the specified output
    folder within the data directory
    """

    results = parsing.container(target)
    results_directory = os.path.join(DATA_DIRECTORY, output_folder)
    clean(results_directory)

    for entry in results.get('functions', []):
        write_entry(results_directory, entry)

    for entry in results.get('variables', []):
        write_entry(results_directory, entry)

    for entry in results.get('classes', []):
        write_entry(results_directory, entry)

    write_entry(
        results_directory,
        dict(name=results.get('name', 'Unknown'),
             description=results.get('description', '')))