def setUp(self): self.pc = PlayContext() self.pc.network_os = "f5networks.f5_bigip.bigiq" self.connection = connection_loader.get("httpapi", self.pc, "/dev/null") self.mock_send = MagicMock() self.connection.send = self.mock_send self.client = F5Client(client=self.connection.httpapi)
def test_ansible_version_module_name(): fake_module = MagicMock() fake_module._name = 'fake_module' fake_module.ansible_version = '3.10' f5_client = F5Client(module=fake_module) assert f5_client.module_name == 'fake_module' assert f5_client.ansible_version == '3.10'
def setUp(self): self.pc = PlayContext() self.pc.network_os = "f5networks.f5_bigip.bigip" self.connection = connection_loader.get("httpapi", self.pc, "/dev/null") self.mock_send = MagicMock() self.connection.send = self.mock_send self.start_time = datetime.now().isoformat() self.fake_module = MagicMock() self.fake_module._name = 'fake_module' self.fake_module.ansible_version = '2.10' self.client = F5Client(client=self.connection.httpapi, module=self.fake_module) self.python_version = sys.version.split(' ')[0]