def test_available_domains_with_pkg_dram_rapl_api_two_cpu_return_correct_values(fs_pkg_dram_two_socket): returned_values = RaplDevice.available_domains() correct_values = [RaplPackageDomain(0), RaplDramDomain(0), RaplPackageDomain(1), RaplDramDomain(1)] assert sorted(correct_values) == sorted(returned_values)
def test_available_domains_with_pkg_uncore_and_dram_rapl_api_return_correct_values(fs_pkg_dram_uncore_one_socket): returned_values = RaplDevice.available_domains() correct_values = [RaplPackageDomain(0), RaplDramDomain(0), RaplUncoreDomain(0)] assert sorted(correct_values) == sorted(returned_values)
def test_available_domains_with_pkg_psys_rapl_api_return_correct_values(fs_pkg_psys_one_socket): returned_values = RaplDevice.available_domains() correct_values = [RaplPackageDomain(0)] assert sorted(correct_values) == sorted(returned_values)
def test_available_domains_with_no_rapl_api_raise_NoSuchEnergyDeviceError(empty_fs): with pytest.raises(NoSuchEnergyDeviceError): RaplDevice.available_domains()