def test_add(): c = DummyConnectionControl() conn_type = 'ethernet' options = {'key': 'value'} ifname = 'eth0' name = 'MyHome' autoconnect = True c.add(conn_type, options, ifname, name, autoconnect) assert c.add_args[0] == (conn_type, options, ifname, name, autoconnect)
def test_add_when_raise_error(): c = DummyConnectionControl(raise_error=Exception) with pytest.raises(Exception): c.add('ethernet')