import sys

from skeletor import config
from skeletor.config import Config

from .base import BaseTestCase
from .helpers import nostdout


class OptsTests(BaseTestCase):

    def test_something(self):
        assert True

import optparse

from skeletor.opts import Option

from .base import BaseTestCase


class OptsTests(BaseTestCase):

    def should_raise_exception_when_require_used_incorrectly(self):
        try:
            Option('-n', '--does_not_take_val', action="store_true",
                    default=None, required=True)
        except optparse.OptionError:
            assert True

Test for custom option class
Test for custom option class

- import sys
+ import optparse
  
- from skeletor import config
+ from skeletor.opts import Option
- from skeletor.config import Config
  
  from .base import BaseTestCase
- from .helpers import nostdout
  
  
  class OptsTests(BaseTestCase):
  
-     def test_something(self):
+     def should_raise_exception_when_require_used_incorrectly(self):
+         try:
+             Option('-n', '--does_not_take_val', action="store_true",
+                     default=None, required=True)
+         except optparse.OptionError:
-         assert True
+             assert True
  
Test for custom option class
## Code Before:
import sys

from skeletor import config
from skeletor.config import Config

from .base import BaseTestCase
from .helpers import nostdout


class OptsTests(BaseTestCase):

    def test_something(self):
        assert True

## Instruction:
Test for custom option class
## Code After:
import optparse

from skeletor.opts import Option

from .base import BaseTestCase


class OptsTests(BaseTestCase):

    def should_raise_exception_when_require_used_incorrectly(self):
        try:
            Option('-n', '--does_not_take_val', action="store_true",
                    default=None, required=True)
        except optparse.OptionError:
            assert True
