def test_read_definition_from_json(): expected = utils.load_fixture_json('base.json') base = utils.generate_sandbox() shutil.copyfile(f'{CURR_DIR}/fixtures/base.json', f'{base}/base.json') actual = generate.read_definition_base(root=f'{base}/') assert actual == expected shutil.rmtree(base)
def test_create_definition(): full_comment = utils.load_fixture_json('full_comment.json') base = utils.load_fixture_yml('base.yml') paths = generate.merge_endpoints([full_comment]) expected = {**base, 'paths': paths} base = utils.generate_sandbox() shutil.copyfile(f'{CURR_DIR}/fixtures/base.yml', f'{base}/base.yml') shutil.copyfile(f'{CURR_DIR}/fixtures/full_comment.py', f'{base}/full_comment.py') actual = generate.create_definition(f'{base}/') assert expected == actual shutil.rmtree(base)
def test_read_comments_full(): expected = utils.load_fixture_json('full_comment.json') fixture = utils.load_fixture_unread('full_comment.py') actual = extract.read_comments(fixture) assert [expected] == actual
def test_parse_block_full(): expected = utils.load_fixture_json('full_comment.json') fixture = utils.load_fixture_read('full_comment.py') actual = extract.parse_block(fixture) assert expected == actual