2022-10-22 22:30:40 +01:00
|
|
|
require_relative "../minitest_helper"
|
|
|
|
|
2023-08-11 17:05:33 +01:00
|
|
|
class RequestTest < Minitest::Test
|
2022-10-22 22:30:40 +01:00
|
|
|
def test_it_checks_obs_major_version
|
2023-07-19 15:24:15 +01:00
|
|
|
resp = OBSWSTest.r_client.get_version
|
2022-10-22 22:30:40 +01:00
|
|
|
ver = resp.obs_version.split(".").map(&:to_i)
|
|
|
|
assert ver[0] >= 28
|
|
|
|
end
|
|
|
|
|
|
|
|
def test_it_checks_ws_major_version
|
2023-07-19 15:24:15 +01:00
|
|
|
resp = OBSWSTest.r_client.get_version
|
2022-10-22 22:30:40 +01:00
|
|
|
ver = resp.obs_web_socket_version.split(".").map(&:to_i)
|
|
|
|
assert ver[0] >= 5
|
|
|
|
end
|
|
|
|
|
|
|
|
def test_it_sets_and_gets_current_program_scene
|
|
|
|
%w[START_TEST BRB_TEST END_TEST].each do |s|
|
2023-07-19 15:24:15 +01:00
|
|
|
OBSWSTest.r_client.set_current_program_scene(s)
|
|
|
|
resp = OBSWSTest.r_client.get_current_program_scene
|
2022-10-22 22:30:40 +01:00
|
|
|
assert resp.current_program_scene_name == s
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def test_stream_service_settings
|
|
|
|
settings = {
|
|
|
|
server: "rtmp://addressofrtmpserver",
|
|
|
|
key: "live_myvery_secretkey"
|
|
|
|
}
|
2023-07-19 15:24:15 +01:00
|
|
|
OBSWSTest.r_client.set_stream_service_settings("rtmp_common", settings)
|
|
|
|
resp = OBSWSTest.r_client.get_stream_service_settings
|
2022-10-22 22:30:40 +01:00
|
|
|
assert resp.stream_service_type == "rtmp_common"
|
|
|
|
assert resp.stream_service_settings ==
|
2023-07-19 15:10:38 +01:00
|
|
|
{
|
|
|
|
server: "rtmp://addressofrtmpserver",
|
|
|
|
key: "live_myvery_secretkey"
|
|
|
|
}
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
end
|