Exemple #1
0
def test_d3_html_page_generator(example_yaml_path, example_html_path):
  with open(example_yaml_path) as input_file:
    left = "\n".join(pedigree_lib.d3_html_page_generator(
        pedigree_lib.yaml_to_family(input_file)))
    with open(example_html_path) as output_file:
      right = output_file.read()
    assert  left == right

  with open(example2_yaml_path) as input_file:
    with open(example2_html_path) as output_file:
      assert(
        "\n".join(pedigree_lib.d3_html_page_generator(
          pedigree_lib.yaml_to_family(input_file))) == \
              output_file.read()
      )
def test_dot_file_generator(example2_yaml_path, example2_dot_path):
    with open(example2_yaml_path) as input_file:
        with open(example2_dot_path) as output_file:
            received = "\n".join(
                pedigree_lib.dot_file_generator(
                    pedigree_lib.yaml_to_family(input_file))) + "\n"
            assert (received == output_file.read())
def test_d3_html_page_generator(example_yaml_path, example_html_path):
    with open(example_yaml_path) as input_file:
        left = "\n".join(
            pedigree_lib.d3_html_page_generator(
                pedigree_lib.yaml_to_family(input_file)))
        with open(example_html_path) as output_file:
            right = output_file.read()
        assert left == right

    with open(example2_yaml_path) as input_file:
        with open(example2_html_path) as output_file:
            assert(
              "\n".join(pedigree_lib.d3_html_page_generator(
                pedigree_lib.yaml_to_family(input_file))) == \
                    output_file.read()
            )
Exemple #4
0
def test_dot_file_generator(example2_yaml_path, example2_dot_path):
  with open(example2_yaml_path) as input_file:
    with open(example2_dot_path) as output_file:
      received = "\n".join(pedigree_lib.dot_file_generator(
          pedigree_lib.yaml_to_family(input_file))) + "\n"
      assert(received == output_file.read())
Exemple #5
0
def test_family_to_yaml(family, example2_yaml_path):
  with open(example2_yaml_path) as output_file:
    right_side = output_file.read()
  left_side = pedigree_lib.family_to_yaml(family)
  assert pedigree_lib.yaml_to_family(left_side) == \
      pedigree_lib.yaml_to_family(right_side)
Exemple #6
0
def test_yaml_to_family(family, example2_yaml_path):
  with open(example2_yaml_path) as input_file:
    assert pedigree_lib.yaml_to_family(input_file.read()) == \
        family
def test_family_to_yaml(family, example2_yaml_path):
    with open(example2_yaml_path) as output_file:
        right_side = output_file.read()
    left_side = pedigree_lib.family_to_yaml(family)
    assert pedigree_lib.yaml_to_family(left_side) == \
        pedigree_lib.yaml_to_family(right_side)
def test_yaml_to_family(family, example2_yaml_path):
    with open(example2_yaml_path) as input_file:
        assert pedigree_lib.yaml_to_family(input_file.read()) == \
            family