def test_error_duplicates_in_nt_col(self): df = pd.DataFrame({ constants.nt_variant_col: ["c.100A>G", "c.100A>G"], constants.pro_variant_col: ["p.G4L", "p.G4L"], }) with self.assertRaises(ValueError): validators.validate_mavedb_compliance(df, df_type=None)
def test_error_primary_column_as_pro_contains_null(self): df = pd.DataFrame({ constants.nt_variant_col: [None, None], constants.pro_variant_col: ["p.G4L", None], }) with self.assertRaises(ValueError): validators.validate_mavedb_compliance(df, df_type=None)
def test_error_neither_column_defines_variants(self): df = pd.DataFrame({ constants.nt_variant_col: [None, None], constants.pro_variant_col: [None, None], }) with self.assertRaises(ValueError): validators.validate_mavedb_compliance(df, df_type=None)
def test_keyerror_missing_score_column_df_type_is_scores(self): df = pd.DataFrame({ constants.pro_variant_col: [None, "pG4L"], constants.nt_variant_col: ["c.100A>G", "c.101A>G"], }) with self.assertRaises(KeyError): validators.validate_mavedb_compliance(df, df_type=constants.score_type)
def test_pass_coding_(self): df = pd.DataFrame({ constants.nt_variant_col: ["c.100A>G", "c.101A>G"], constants.pro_variant_col: ["p.G4L", "p.G5L"], }) validators.validate_mavedb_compliance(df, df_type=None) df = pd.DataFrame({ constants.nt_variant_col: ["n.100A>G", "n.101A>G"], constants.pro_variant_col: [None, None], }) validators.validate_mavedb_compliance(df, df_type=None)
def test_allows_duplicates_in_pro_col(self): df = pd.DataFrame({ constants.nt_variant_col: [None, None], constants.pro_variant_col: ["p.G4L", "p.G4L"], }) validators.validate_mavedb_compliance(df, df_type=None) # passes
def test_error_missing_nt_pro_columns(self): df = pd.DataFrame({"A": ["c.100A>G", "c.101A>G"], "B": [None, None]}) with self.assertRaises(ValueError): validators.validate_mavedb_compliance(df, df_type=None)