コード例 #1
0
  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
コード例 #2
0
    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
コード例 #3
0
  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