omaciel/robottelo — pull request #565 by omaciel (2014-03-24 20:21:10+00:00)
Title: Removed create_minimal method from Subnet CLI.

As per issue #526, I have handled the pending TODO for removing the
existing ``create_minimal`` method and updated tests to use existing
factory method. I have also updated existing tests to use data driven
values as well as removed the need to create a subnet in the module's
setUp method.

Also had to remove existing ``test_update_success_ddt`` test as it was
not really performing a thorough assertion. Turns out this will require
a bit more work as the attributes that are passed via CLI are not in the
same format as what's being returned:

Example:

```bash
Usage:
hammer subnet create [OPTIONS]

Options:
--dns-primary DNS_PRIMARY Primary DNS for this subnet
--dns-secondary DNS_SECONDARY Secondary DNS for this subnet
--vlanid VLANID VLAN ID for this subnet
```

compared to

```python
In [2]: foo = Subnet.info({'id': 138})

In [3]: foo.stdout
Out[3]:
{u'dhcp': u'""',
u'dhcp-id': u'""',
u'dns': u'""',
u'dns-id': u'""',
u'domain-ids': u'""',
u'from': u'""',
u'gateway': u'""',
u'id': u'138',
u'mask': u'255.255.255.0',
u'name': u'abvafrvz',
u'network': u'94.22.201.0',
u'primary-dns': u'""',
u'priority': u'""',
u'secondary-dns': u'""',
u'tftp': u'""',
u'tftp-id': u'""',
u'to': u'""',
u'vlan-id': u'1'}
```

Note how ``vlandid`` and ``vlan-id`` differ. Also, ``dns-primary`` and
``primary-dns``. I'll file a BZ for that.

```bash
$ nosetests -c robottelo.properties tests/cli/test_subnet.py

@Feature: Subnet - List ... ok
@Test: Check if Subnet can be created with random names ... ok
@Test: Check if Subnet can be created with random names ... ok
@Test: Check if Subnet can be created with random names ... ok
@Test: Check if Subnet can be created with random names ... ok
@Test: Check if Subnet can be created with random names ... ok
@Test: Check if Subnet can be created with random names ... ok
@Test: Check if Subnet can be deleted ... ok
@Test: Check if Subnet can be deleted ... ok
@Test: Check if Subnet can be deleted ... ok
@Test: Check if Subnet can be deleted ... ok
@Test: Check if Subnet can be deleted ... ok
@Test: Check if Subnet can be deleted ... ok
@Test: Check if Subnet name can be updated ... ok
@Test: Check if Subnet name can be updated ... ok
@Test: Check if Subnet name can be updated ... ok
@Test: Check if Subnet name can be updated ... ok
@Test: Check if Subnet name can be updated ... ok
@Test: Check if Subnet name can be updated ... ok

----------------------------------------------------------------------
XML: foreman-results.xml
----------------------------------------------------------------------
Ran 19 tests in 322.925s
```