def test_updatePositions_9(qtbot): app = SatelliteWindow(app=Test()) qtbot.addWidget(app) tle = ["TIANGONG 1", "1 37820U 11053A 14314.79851609 .00064249 00000-0 44961-3 0 5637", "2 37820 42.7687 147.7173 0010686 283.6368 148.1694 15.73279710179072"] app.satellite = EarthSatellite(*tle[1:3], name=tle[0]) fig = plt.figure() ax = fig.add_subplot(111, projection='3d') app.plotSatPosEarth, = plt.plot([1, 0], [1, 0]) app.plotSatPosHorizon, = plt.plot([1, 0], [1, 0]) app.plotSatPosSphere1, = ax.plot([1], [1], [1]) app.plotSatPosSphere2, = ax.plot([1], [1], [1]) now = app.app.mount.obsSite.ts.now() observe = app.satellite.at(now) subpoint = observe.subpoint() difference = app.satellite - app.app.mount.obsSite.location altaz = difference.at(now).altaz() with mock.patch.object(app.plotSatPosSphere1, 'set_data_3d'): with mock.patch.object(app.plotSatPosSphere2, 'set_data_3d'): with mock.patch.object(app.plotSatPosEarth, 'set_data'): with mock.patch.object(app.plotSatPosHorizon, 'set_data'): suc = app.updatePositions(observe=observe, subpoint=subpoint, altaz=altaz) assert suc
def test_updatePositions_7(qtbot): app = SatelliteWindow(app=Test()) qtbot.addWidget(app) app.satellite = 1 app.plotSatPosEarth = 1 app.plotSatPosHorizon = 1 suc = app.updatePositions(observe='t', subpoint='t', altaz='t') assert not suc