def test_net_interface_names_returns_set_of_strings(self): interface_names = self.linux.net_interface_names() assert_is_instance(interface_names, set) for interface_name in interface_names: assert_is_instance(interface_name, string_types) assert_in(PRESENT_INTERFACE, interface_names)
def test_net_interface_infos_works_with_joined_names(self, mock_lines): mock_lines.return_value = self.NET_INFO_JOINED_NAME assert_in(PRESENT_INTERFACE, self.linux.net_interface_names())
def test_swap_device_names(self): swap_devices = self.linux.swap_device_names() disk_devices = self.linux.disk_device_names() for swap_device in swap_devices: assert_in(swap_device, disk_devices)
def test_memory_dict_contains_all_available_memory_types(self): d = self.linux.memory() for memory_type in self.linux.AVAILABLE_MEMORY_TYPES: assert_in(memory_type, d)
def test_function_inserts_arguments_into_command(self): sh(COMMAND_WITH_ARGUMENTS)(ARGUMENT) command = self.mock_popen.call_args[0][0] assert_in(ARGUMENT, command)
def test_command_output_is_returned(self): result = sh(COMMAND)() assert_true(not result.endswith('\n')) assert_in(result, STDOUT)