def test_system_register_update_data(self): # Register the standard plugin, then stop it plugin = create_plugin("test", "1.0.0", TestPluginV1) start_plugin(plugin, self.easy_client) assert_system_running(self.easy_client, "test", "1.0.0") stop_plugin(plugin) # Now create the new plugin and register that one plugin = create_plugin("test", "1.0.0", TestPluginV1BetterDescriptions, description="A better description", metadata={"foo": "bar"}, icon_name="fa-coffee", display_name="new_display_name") start_plugin(plugin, self.easy_client) assert_system_running(self.easy_client, "test", "1.0.0", system={ "description": "A better description", "metadata": { "foo": "bar" }, "icon_name": "fa-coffee", 'display_name': 'new_display_name' }) stop_plugin(plugin)
def test_system_register_same_instance_name(self): plugin = create_plugin("test", "1.0.0", TestPluginV1) start_plugin(plugin, self.easy_client) assert_system_running(self.easy_client, "test", "1.0.0") plugin = create_plugin("test", "1.0.0", TestPluginV1) with pytest.raises(ValidationError): self.easy_client.create_system(plugin.system)
def test_system_register_different_commands_should_fail(self): plugin = create_plugin("test", "1.0.0", TestPluginV1) start_plugin(plugin, self.easy_client) assert_system_running(self.easy_client, "test", "1.0.0") stop_plugin(plugin) plugin = create_plugin("test", "1.0.0", TestPluginV2) with pytest.raises(ValidationError): self.easy_client.create_system(plugin.system)
def test_system_register_dev_different_commands(self): # Register the standard plugin, then stop it plugin = create_plugin("test", "1.0.0.dev", TestPluginV1) start_plugin(plugin, self.easy_client) assert_system_running(self.easy_client, "test", "1.0.0.dev") stop_plugin(plugin) # Now create the new plugin and register that one plugin = create_plugin("test", "1.0.0.dev", TestPluginV2) start_plugin(plugin, self.easy_client) assert_system_running(self.easy_client, "test", "1.0.0.dev") stop_plugin(plugin)
def test_system_register_same_display_name(self): plugin = create_plugin("test", "1.0.0", TestPluginV1, display_name="TEST") start_plugin(plugin, self.easy_client) assert_system_running(self.easy_client, "test", "1.0.0") new_plugin = create_plugin("new_test", "1.0.0", TestPluginV1, display_name="TEST") with pytest.raises(ConflictError): self.easy_client.create_system(new_plugin.system)
def test_system_register_different_versions(self): plugin = create_plugin("test", "1.0.0", TestPluginV1) start_plugin(plugin, self.easy_client) assert_system_running(self.easy_client, "test", "1.0.0") plugin = create_plugin("test", "2.0.0", TestPluginV2) start_plugin(plugin, self.easy_client) assert_system_running(self.easy_client, "test", "1.0.0") assert_system_running(self.easy_client, "test", "2.0.0")
def test_system_register_successful(self): plugin = create_plugin("test", "1.0.0", TestPluginV1) start_plugin(plugin, self.easy_client) assert_system_running(self.easy_client, "test", "1.0.0") stop_plugin(plugin)