Пример #1
0
    def test_alleleHasNoSeparator_raisesError(self):
        row = ",".join(
            ["lineage1", "615938", "1104", "GA", "368", "GAG/GAA", "E/E", "foo", "",]
        )

        with pytest.raises(ValueError):
            PanelVariant.from_row(row)
Пример #2
0
    def test_geneNameIsEmpty_returnsNone(self):
        row = ",".join(
            ["lineage1", "615938", "1104", "G/A", "368", "GAG/GAA", "E/E", "foo", "",]
        )

        actual = PanelVariant.from_row(row)
        expected = PanelVariant(Lineage("1"), 615938, "G", "A", "foo", None, 1104)

        assert actual == expected
Пример #3
0
    def test_tabAsDelim_returnsExpected(self):
        delim = "\t"
        row = delim.join(
            ["lineage1", "615938", "1104", "G/A", "368", "GAG/GAA", "E/E", "foo", "",]
        )

        actual = PanelVariant.from_row(row, delim=delim)
        expected = PanelVariant(Lineage("1"), 615938, "G", "A", "foo", None, 1104)

        assert actual == expected
Пример #4
0
    def test_geneCoordIsntInt_returnsNone(self):
        row = ",".join(
            [
                "lineage1",
                "615938",
                "foo",
                "G/A",
                "368",
                "GAG/GAA",
                "E/E",
                "Rv0524",
                "hemL",
            ]
        )

        actual = PanelVariant.from_row(row)
        expected = PanelVariant(Lineage("1"), 615938, "G", "A", "Rv0524", "hemL", None)

        assert actual == expected
Пример #5
0
 def test_rowPositionFieldMissing_raisesError(self):
     row = "foo,,,,"
     with pytest.raises(ValueError):
         PanelVariant.from_row(row)
Пример #6
0
 def test_rowWithNoFields_raisesError(self):
     row = ",,,,"
     with pytest.raises(RowError):
         PanelVariant.from_row(row)
Пример #7
0
 def test_emptyRow_raisesError(self):
     row = ""
     with pytest.raises(RowError):
         PanelVariant.from_row(row)