def test_default_attributes(self): action = actions.Action(['--foo'], dests=['foo']) self.assertEqual(action.option_strings, ['--foo']) self.assertEqual(action.dests, ['foo']) self.assertEqual(action.const, None) self.assertEqual(action.default, None) self.assertEqual(action.type, None) self.assertEqual(action.choices, None) self.assertEqual(action.required, False) self.assertEqual(action.help, None) self.assertEqual(action.metavar, None) self.assertEqual(action.dest, SUPPRESS)
def test_call_not_implemented(self): action = actions.Action([], []) with self.assertRaises(NotImplementedError): action(None, None, None, None)
def test_supports_dest_argument(self): action = actions.Action([], [], dest='foo') self.assertEqual(action.dest, SUPPRESS)
def test_multiple_destinations(self): action = actions.Action(['--foo'], ['foo', 'bar']) self.assertEqual(action.dests, ['foo', 'bar'])
def test_single_destination(self): action = actions.Action(['--foo'], 'foo') self.assertEqual(action.dests, ['foo'])