def test_no_server(self): with mock.patch('cloudenvy.template.Template') as m: instance = m.return_value instance.server.return_value = False main.ip(self.args) assert instance.server.called assert not instance.ip.called
def test_basic(self): with mock.patch('cloudenvy.template.Template') as m: instance = m.return_value instance.server.return_value = True instance.ip.return_value = '10.0.0.1' main.ip(self.args) assert instance.server.called assert instance.ip.called