Skip to content

Instantly share code, notes, and snippets.

View AdamSaleh's full-sized avatar

Adam Saleh AdamSaleh

View GitHub Profile
class Operatingsystem(ApiCrudMixin, ApiModelMixin,DataGeneratorMixin):
@classmethod
def api_path(cls):
return "/api/operatingsystems/"
@classmethod
def id_from_json(cls, json):
return json[u'operatingsystem'][u'id']
@AdamSaleh
AdamSaleh / gist:8319983
Created January 8, 2014 16:49
Experiment
import rstr
import re
from random import randint, choice
from functools import partial
import robottelo.api.base as base
import copy
class ApiMixin(object):
set shm=atI " Disable the distracting intro screen.
set lazyredraw " Don't redraw the screen during macros.
set ttyfast " Improves redrawing for "newer" computers
" (where "newer" is defined as "not ancient").
set timeoutlen=500 " Lower timeout for custom mappings.
set go+=a
set clipboard=unnamed
class Environment2(ApiMixin):
class Meta:
class Generator:
required = ('name')
definitions = dict(
name = regexdef(r"environment_\d\d\d"))
class Api:
api_path = "/api/environments/"
json_key = u'environment'
import rstr
import re
from random import randint, choice
from functools import partial
import robottelo.api.base as base
import inspect
class Field(object):
"""Base class for all fields"""
def __init__(self,value = None, required=False):
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