omaciel/robottelo — pull request #499 by omaciel (2014-03-12 02:05:34+00:00)
Title: Update CLI organization environments tests.

Organizations use "Lifecycle-Environments" and not what Foreman calls
"environments", so our two existing Organization tests that add/remove
environments needed to be updated. I have updated the code to add a new
"make_lifecycle_environment" method and in the process I filed Bugzilla
1075282. The tests should work once the issue is handled by the
developers.

```python
In [1]: from robottelo.cli.lifecycleenvironment import LifecycleEnvironment
INFO ssh:63: Paramiko instance prepared (and would be reused): 0x10326fd90

In [2]: foo = LifecycleEnvironment.list({'organization-id': 'ACME_Corporation'})

In [3]: foo.stdout
Out[3]: [{'id': '1', 'name': 'Library'}, {'id': '86', 'name': 'DEV'}]

In [4]: foo = LifecycleEnvironment.list({'organization-id': 'ACME_Corporation', 'library': 1})

In [5]: foo.stdout
Out[5]: [{'id': '1', 'name': 'Library'}]

In [6]: foo = LifecycleEnvironment.list({'organization-id': 'ACME_Corporation', 'name': 'DEV'})

In [7]: foo.stdout
Out[7]: [{'id': '86', 'name': 'DEV'}]

In [8]: from robottelo.cli.factory import make_lifecycle_environment

In [9]: make_lifecycle_environment({'organization-id': 'ACME_Corporation'})
Out[9]:
{'description': '""',
'id': '124',
'label': '2nwbudt',
'library': '""',
'name': '2nwbudt',
'organization': 'ACME_Corporation',
'organization-id': 'ACME_Corporation',
'prior': '1',
'prior-lifecycle-environment': 'Library'}

In [10]: make_lifecycle_environment({'organization-id': 'ACME_Corporation', 'prior': 124})
Out[10]:
{'description': '""',
'id': '125',
'label': 'xaz6uq',
'library': '""',
'name': 'xaz6uq',
'organization': 'ACME_Corporation',
'organization-id': 'ACME_Corporation',
'prior': 124,
'prior-lifecycle-environment': '2nwbudt'}
```