示例#1
0
 def setUp(self):
     # Initialize the experiment for testing.
     # We set the archimedes_real_device setting to False so that
     # it doesn't attempt to contact the real ip.
     self.cfg_manager = ConfigurationManager()
     self.cfg_manager._set_value("archimedes_real_device", False)
     self.cfg_manager._set_value("archimedes_instances", {
         "default": "http://localhost:8000",
         "second": "http://localhost:8001"
     })
     self.experiment = Archimedes(None, None, self.cfg_manager)
     self.lab_session_id = SessionId('my-session-id')
示例#2
0
    def test_unknown_instance(self):
        """
        Check that it replies an error if the instance isn't in the config.
        """
        self.cfg_manager = ConfigurationManager()
        self.cfg_manager._set_value("archimedes_instances", {
            "first": "http://localhost:8000",
            "second": "http://localhost:8001"
        })
        self.experiment = Archimedes(None, None, self.cfg_manager)
        start = self.experiment.do_start_experiment("{}", "{}")

        up_resp = self.experiment.do_send_command_to_device("UP")
        assert up_resp.startswith("ERROR:")

        up_resp = self.experiment.do_send_command_to_device("default:UP")
        assert up_resp.startswith("ERROR:")