Skip to content

Instantly share code, notes, and snippets.

View AdamSaleh's full-sized avatar

Adam Saleh AdamSaleh

View GitHub Profile
from robottelo.records.organization import Organization
from robottelo.api.apicrud import ApiCrud
o = Organization()
o_r = ApiCrud.record_create(o)
from robottelo.api.apicrud import ApiCrud
from robottelo.common import records
from robottelo.records.operatingsystem import OperatingSystem
class ArchitectureApi(ApiCrud):
api_path = "/api/architectures/"
api_json_key = u"architecture"
create_fields = ["name", "operatingsystem_ids"]
from .architecture import Architecture # noqa
from .domain import Domain # noqa
from .environment import Environment # noqa
from .host import Host # noqa
from .operatingsystem import OperatingSystem # noqa
from .partitiontable import PartitionTable # noqa
from .smartproxy import SmartProxy # noqa
<?xml version="1.0" encoding="UTF-8"?>
<testsuite name="nosetests" tests="45" errors="0" failures="0" skip="0">
<testcase classname="tests.api.test_organization.Organization" name="test_positive_create_1_[('description', ''), ('name', '13413865706422125318'), ('label', '')]" time="1.746"/>
<testcase classname="tests.api.test_organization.Organization" name="test_positive_create_1_[('description', ''), ('name', '&lt;ol&gt;JZUXHsrGNFihrtULGmnv&lt;/ol&gt;'), ('label', '')]" time="1.809"/>
<testcase classname="tests.api.test_organization.Organization" name="test_positive_create_1_[('description', ''), ('name', 'YSdOUITEQIZNREMXOXNk'), ('label', '')]" time="2.068"/>
<testcase classname="tests.api.test_organization.Organization" name="test_positive_create_1_[('description', ''), ('name', 'xZfUNEp0qZui6VXydmzl'), ('label', '')]" time="2.165"/>
<testcase classname="tests.api.test_organization.Organization" name="test_positive_create_1_[('description', ''), ('name', u'\u6b22\u5aee\u9944\u6563\u7ac8
# -*- encoding: utf-8 -*-
# vim: ts=4 sw=4 expandtab ai
"""
Test class for Organization UI
"""
from ddt import data, ddt
from robottelo.common.helpers import generate_name
from robottelo.common.constants import NOT_IMPLEMENTED
curl -X POST -k -u admin:changeme -H "Content-Type: application/json" 'https://qetello01.usersys.redhat.com/katello/api/v2/activation_keys/' -d '{"content_view_id": 1, "usage_limit": 7, "environment_id": 1, "description": "0ZqOMEgldXWg65J58ir7", "organization_id": 1, "name": "10jqqdjLvBIMoESNURCkv"}'
{"displayMessage":"undefined method `attriubtes' for #<Rabl::Engine:0x007f5461d2aa20>","errors":["undefined method `attriubtes' for #<Rabl::Engine:0x007f5461d2aa20>"]}
curl -X POST -k -u admin:changeme -H "Content-Type: application/json" 'https://qetello01.usersys.redhat.com/katello/api/v2/products/' -d '{"organization_id": 1, "description": "test-prod-desc", "name": "test-product1"}'
{"displayMessage":"PGError: ERROR: operator does not exist: character varying = integer\nLINE 1: ...\"taxonomies\".\"deletion_task_id\" IS NULL AND (name = 1 or lab...\n ^\nHINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.\n: SELECT \"taxonomies\".* FROM \"taxonomies\" WHERE \"taxonomies\".\"type\" IN ('Organization') AND \"taxonomies\".\"deletion_task_id\" IS NULL AND (name = 1 or label = 1) ORDER BY title LIMIT 1","errors":["PGError: ERROR: operator does not exist: character varying = integer\nLINE 1: ...\"taxonomies\".\"deletion_task_id\" IS NULL AND (name = 1 or lab...\n ^\nHINT: No operator matches the give
======================================================================
ERROR: test_remove (tests.foreman.api.test_host.TestHost)
----------------------------------------------------------------------
Traceback (most recent call last):
File "tests/foreman/api/test_host.py", line 34, in test_remove
ApiCrud.record_create_recursive(h)
File "robottelo/api/apicrud.py", line 547, in record_create_recursive
return api.record_create_recursive(instance_orig, user=user)
File "robottelo/api/apicrud.py", line 548, in record_create_recursive
res_instance = cls.record_create_dependencies(instance_orig, user=user)
======================================================================
ERROR: test_remove (tests.foreman.api.test_host.TestHost)
----------------------------------------------------------------------
Traceback (most recent call last):
File "tests/foreman/api/test_host.py", line 34, in test_remove
ApiCrud.record_create_recursive(h)
File "robottelo/api/apicrud.py", line 547, in record_create_recursive
return api.record_create_recursive(instance_orig, user=user)
File "robottelo/api/apicrud.py", line 548, in record_create_recursive
res_instance = cls.record_create_dependencies(instance_orig, user=user)
======================================================================
ERROR: test_update_ActivationKey(content_view_id=1, usage_limit=4, environment_id=1, description=u'a3ih7H42Gkp4heqBOvsY', organization_id=1, name=u'\xc4\xce\xd2\xf2\xd5\xe1\xc5\xcd\xea\xdc\xfc\xf2\xc0\xce\xc1\xc3\xe9\xd3\xf0\xde') (tests.foreman.api.test_activationkey.ActivationKeys)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/asaleh/.virtualenvs/renv/lib/python2.7/site-packages/ddt.py", line 81, in wrapper
return func(self, *args, **kwargs)
File "tests/foreman/api/test_activationkey.py", line 39, in test_update
ak_cr = ApiCrud.record_create(test_data)
File "robottelo/api/apicrud.py", line 483, in record_create
return api.record_create(instance_orig, user=user)