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)
    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
    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
    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
 def test_rowPositionFieldMissing_raisesError(self):
     row = "foo,,,,"
     with pytest.raises(ValueError):
         PanelVariant.from_row(row)
 def test_rowWithNoFields_raisesError(self):
     row = ",,,,"
     with pytest.raises(RowError):
         PanelVariant.from_row(row)
 def test_emptyRow_raisesError(self):
     row = ""
     with pytest.raises(RowError):
         PanelVariant.from_row(row)