def test_add_duplicate_shortcut_option(self): self.initialize_options() definition = InputDefinition() definition.add_option(self.foo) self.assertRaisesRegexp( Exception, 'An option with shortcut "f" already exists.', definition.add_option, self.foo1 )
def test_add_option(self): self.initialize_options() definition = InputDefinition() definition.add_option(self.foo) self.assertEqual([self.foo], definition.get_options()) definition.add_option(self.bar) self.assertEqual([self.foo, self.bar], definition.get_options())
def test_add_duplicate_shortcut_option(self): self.initialize_options() definition = InputDefinition() definition.add_option(self.foo) self.assertRaisesRegexp(Exception, 'An option with shortcut "f" already exists.', definition.add_option, self.foo1)
def test_add_duplicate_option(self): self.initialize_options() definition = InputDefinition() definition.add_option(self.foo) self.assertRaisesRegexp(Exception, 'An option named "foo" already exists.', definition.add_option, self.foo2)