def test_new_chain(self):
        self.assertEqual(iptables.new_chain(table='filter', chain=None,
                                                   family='ipv4'),
                         'Error: Chain needs to be specified')

        mock_cmd = MagicMock(return_value='')
        with patch.dict(iptables.__salt__, {'cmd.run': mock_cmd}):
            self.assertTrue(iptables.new_chain(table='filter',
                                                       chain='INPUT',
                                                       family='ipv4'))

    # 'delete_chain' function tests: 1
Test if it create new custom chain to the specified table.
dataset/ETHPy150Open saltstack/salt/tests/unit/modules/iptables_test.py/IptablesTestCase.test_new_chain