def test_user_vms_dict2et(self): user_vm_dict = json.loads(self._get_single_vm_as_json()) user_vm_etree = one_query._user_vms_dict2et(user_vm_dict) assert type(ET.Element('a')) == type(user_vm_etree) assert 'user' == user_vm_etree.tag assert 1 == len(user_vm_etree.getiterator('vm')) user_vms_dict = json.loads(self._get_multiple_vms_as_json()) user_vms_etree = one_query._user_vms_dict2et(user_vms_dict) assert type(ET.Element('a')) == type(user_vms_etree) assert 'user' == user_vms_etree.tag assert 2 == len(user_vms_etree.getiterator('vm'))
def test_user_vms_dict2et_none(self): assert None == one_query._user_vms_dict2et({})