def test_smoke_test_generates_successfully(self, mock_writer): aclgen.Run( self.pol_dir, self.def_dir, None, self.test_subdirectory, self.exp_info, self.max_renderers, self.ignore_directories, None, None, self.context, ) files = ['sample_cisco_lab.acl', 'sample_cloudarmor.gca', 'sample_gce.gce', 'sample_ipset.ips', 'sample_juniper_loopback.jcl', 'sample_multitarget.acl', 'sample_multitarget.asa', 'sample_multitarget.bacl', 'sample_multitarget.eacl', 'sample_multitarget.ipt', 'sample_multitarget.jcl', 'sample_multitarget.msmpc', 'sample_multitarget.xacl', 'sample_nsxv.nsx', 'sample_packetfilter.pf', 'sample_speedway.ipt', 'sample_srx.srx', 'sample_paloalto.xml', 'sample_stateful_multitarget_simple.xml', 'sample_stateful_multitarget_simple.srx', 'sample_stateful_multitarget_complex.xml', 'sample_stateful_multitarget_complex.srx', ] expected = [mock.call( os.path.join(self.test_subdirectory, f), mock.ANY) for f in files] mock_writer.assert_has_calls(expected, any_order=True)
def test_generate_single_policy(self, mock_writer): policy_file = os.path.join(self.test_subdirectory, 'policies/pol/sample_cisco_lab.pol') aclgen.Run(self.pol_dir, self.def_dir, policy_file, self.test_subdirectory, self.context) mock_writer.assert_called_with( os.path.join(self.test_subdirectory, 'sample_cisco_lab.acl'), mock.ANY)
def test_generate_single_policy(self, mock_writer): policy_file = os.path.join(self.test_subdirectory, 'policies/pol/sample_cisco_lab.pol') aclgen.Run( self.pol_dir, self.def_dir, policy_file, self.test_subdirectory, self.exp_info, self.max_renderers, self.ignore_directories, None, None, self.context, ) mock_writer.assert_called_with( os.path.join(self.test_subdirectory, 'sample_cisco_lab.acl'), mock.ANY)