def METHOD_NAME(self, mock_samples):
    """test for getting gen_pheno txt file"""
    mock_samples.return_value = ["Expected_1", "Expected_2", "Expected_3"]
    trait = AttributeSetter({"name": "TX"})
    dataset = AttributeSetter({"group": AttributeSetter({"name": "n_1"})})
    vals = ["value=K1", "value=K2", "value=K3"]
    with mock.patch("builtins.open", mock.mock_open()) as mock_open:
        results = gen_pheno_txt_file_plink(this_trait=trait, dataset=dataset,
                                           vals=vals, pheno_filename="ph_file")
        mock_open.assert_called_once_with(
            "/home/user/data/ph_file.txt", "wb")
        filehandler = mock_open()
        calls_expected = [mock.call('FID\tIID\tTX\n'),
                          mock.call('Expected_1\tExpected_1\tK1\nExpected_2\tExpected_2\tK2\nExpected_3\tExpected_3\tK3\n')]
        filehandler.write.assert_has_calls(calls_expected)
        filehandler.close.assert_called_once()