def mk_package_test_suite(fname, contents, spec_no):
  """Instantiates a package test specification from a parsed "AST" of a
  package test.

  Parameters
  ----------
  contents : dict

  Returns
  ----------
  PackageTestSpecification

  """
  package = contents.get('package', None)
  description = contents.get('description', None)
  generated_on = contents.get('generated_on', None)
  tests = contents.get('tests', [])
  resolved = [mk_test(test) for test in tests]

  # Get current directory, root directory, and then strip root directory from test suite filename
  curr_file_dir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
  root_libsbp_dir = os.path.realpath(os.path.join(curr_file_dir, '../../../'))
  fname = str.replace(fname, root_libsbp_dir+'/', '')

  return sbp_test.PackageTestSpecification(package=package,
                                  src_filename=fname,
                                  suite_no=spec_no,
                                  description=description,
                                  generated_on=generated_on,
                                  tests=resolved)
def mk_package_test_suite ( fname , contents , spec_no ) : package = contents . get ( 'package' , None ) description = contents . get ( 'description' , None ) generated_on = contents . get ( 'generated_on' , None ) tests = contents . get ( 'tests' , [ ] ) resolved = [ mk_test ( test ) for test in tests ] curr_file_dir = os . path . dirname ( os . path . abspath ( inspect . getfile ( inspect . currentframe ( ) ) ) ) root_libsbp_dir = os . path . realpath ( os . path . join ( curr_file_dir , '../../../' ) ) fname = str . replace ( fname , root_libsbp_dir + '/' , '' ) return sbp_test . PackageTestSpecification ( package = package , src_filename = fname , suite_no = spec_no , description = description , generated_on = generated_on , tests = resolved )
Instantiates a package test specification from a parsed "AST" of a
  package test.

  Parameters
  ----------
  contents : dict

  Returns
  ----------
  PackageTestSpecification