'Tests the fitting routine with similar procedure.
Compares the fitted parameters.'

def test_joint_fitter(self):

    p1 = [14.9, 0.3]
    p2 = [13, 0.4]
    A = 9.8
    p = np.r_[(A, p1, p2)]
    def model(A, p, x):
        return (A * np.exp((((-0.5) / (p[1] ** 2)) * ((x - p[0]) ** 2))))
    def errfunc(p, x1, y1, x2, y2):
        return np.ravel(np.r_[((model(p[0], p[1:3], x1) - y1), (model(p[0], p[3:], x2) - y2))])
    (coeff, _) = optimize.leastsq(errfunc, p, args=(self.x, self.ny1, self.x, self.ny2))
    assert_allclose(coeff, self.jf.fitparams, rtol=(10 ** (-2)))
