def test_initConfig_2(qtbot): app = SatelliteWindow(app=Test()) qtbot.addWidget(app) del app.app.config['satelliteW'] suc = app.initConfig() assert suc
def test_storeConfig_2(qtbot): app = SatelliteWindow(app=Test()) qtbot.addWidget(app) app.app.config['satelliteW'] = {} suc = app.storeConfig() assert suc
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_5(qtbot): app = SatelliteWindow(app=Test()) qtbot.addWidget(app) app.satellite = 1 suc = app.updatePositions(observe='t', subpoint='t', altaz='t') assert not suc
def test_storeConfig_1(qtbot): app = SatelliteWindow(app=Test()) qtbot.addWidget(app) if 'satelliteW' in app.app.config: del app.app.config['satelliteW'] suc = app.storeConfig() assert suc
def test_makeCubeLimits_3(qtbot): app = SatelliteWindow(app=Test()) qtbot.addWidget(app) fig = plt.figure() ax = fig.add_subplot(111, projection='3d') app.makeCubeLimits(ax, hw=3)
def test_initConfig_3(qtbot): app = SatelliteWindow(app=Test()) qtbot.addWidget(app) app.app.config['satelliteW'] = {} app.app.config['satelliteW']['winPosX'] = 10000 app.app.config['satelliteW']['winPosY'] = 10000 suc = app.initConfig() 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
def test_receiveSatelliteAndShow_2(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"] satellite = EarthSatellite(*tle[1:3], name=tle[0]) suc = app.receiveSatelliteAndShow(satellite=satellite) assert suc
def test_drawHorizonView_1(qtbot): app = SatelliteWindow(app=Test()) qtbot.addWidget(app) app.drawHorizonView()
def test_drawEarth_1(qtbot): app = SatelliteWindow(app=Test()) qtbot.addWidget(app) app.drawEarth()
def test_drawSphere2_1(qtbot): app = SatelliteWindow(app=Test()) qtbot.addWidget(app) app.drawSphere2()
def test_updatePositions_2(qtbot): app = SatelliteWindow(app=Test()) qtbot.addWidget(app) suc = app.updatePositions(observe='t') assert not suc
def test_receiveSatelliteAndShow_1(qtbot): app = SatelliteWindow(app=Test()) qtbot.addWidget(app) suc = app.receiveSatelliteAndShow() assert not suc
def test_resizeEvent(qtbot): app = SatelliteWindow(app=Test()) qtbot.addWidget(app) app.resizeEvent(None)
def test_closeEvent_1(qtbot): app = SatelliteWindow(app=Test()) qtbot.addWidget(app) app.closeEvent(QCloseEvent())