Beispiel #1
0
 def test_no_override_from_options(self):
     # Need to use a new instance since self.configuration is modified.
     configuration = SimulationConfig()
     configuration.load_proposals()
     self.options.frac_duration = -1
     sim = Simulator(self.options, configuration, self.mock_socs_db)
     self.assertEquals(sim.duration, 3650.0)
Beispiel #2
0
    def setUp(self):
        self.time_tolerance = 1e-6
        self.starting_timestamp = 1664582400.0

        patcher1 = mock.patch(
            "lsst.sims.ocs.sal.sal_manager.SalManager.set_publish_topic")
        self.addCleanup(patcher1.stop)
        self.mock_salmanager_pub_topic = patcher1.start()
        patcher2 = mock.patch(
            "lsst.sims.ocs.sal.sal_manager.SalManager.set_subscribe_topic")
        self.addCleanup(patcher2.stop)
        self.mock_salmanager_sub_topic = patcher2.start()
        patcher3 = mock.patch("lsst.sims.ocs.database.socs_db.SocsDatabase",
                              spec=True)
        self.addCleanup(patcher3.stop)
        self.mock_socs_db = patcher3.start()
        patcher4 = mock.patch(
            "lsst.sims.ocs.kernel.sequencer.AstronomicalSkyModel", spec=True)
        self.addCleanup(patcher4.stop)
        self.mock_astro_sky = patcher4.start()

        import collections

        self.options = collections.namedtuple("options", [
            "frac_duration", "no_scheduler", "scheduler_version",
            "scheduler_timeout"
        ])
        self.options.frac_duration = 0.5
        self.options.no_scheduler = True
        self.options.scheduler_version = "v0.8"
        self.options.scheduler_timeout = 60.0

        self.configuration = SimulationConfig()
        self.configuration.load_proposals()

        self.sim = Simulator(self.options, self.configuration,
                             self.mock_socs_db)
Beispiel #3
0
 def setUp(self):
     self.conf_comm = ConfigurationCommunicator()
     self.sal = SalManager()
     self.sal.initialize()
     self.config = SimulationConfig()
     self.config.load_proposals()