~ruby/pythoscope/itrade-fixes

« back to all changes in this revision

Viewing changes to test/test_generator.py

  • Committer: Michal Kwiatkowski
  • Date: 2009-01-28 15:10:49 UTC
  • Revision ID: constant.beta@gmail.com-20090128151049-7imunq6ntpvs5f8m
Test generator no longer ignores special methods.

Show diffs side-by-side

added added

removed removed

Lines of Context:
169
169
        assert_doesnt_contain(result, "from nose import SkipTest")
170
170
 
171
171
    def test_ignores_private_methods(self):
172
 
        objects = [Class('SomeClass', map(Method, ['_semiprivate', '__private', '__eq__']))]
 
172
        objects = [Class('SomeClass', map(Method, ['_semiprivate', '__private']))]
173
173
        result = generate_single_test_module(objects=objects)
174
174
        assert_doesnt_contain(result, "class TestSomeClass(unittest.TestCase):")
175
175
 
 
176
    def test_doesnt_ignore_special_methods(self):
 
177
        objects = [Class('SomeClass', map(Method, ['__eq__', '__init__']))]
 
178
        result = generate_single_test_module(objects=objects)
 
179
        assert_contains(result, "class TestSomeClass(unittest.TestCase):")
 
180
        assert_contains(result, "def test___eq__(self):")
 
181
        assert_contains(result, "def test___init__(self):")
 
182
 
176
183
    def test_ignores_private_functions(self):
177
184
        result = generate_single_test_module(objects=[Function('_function')])
178
185
        assert_doesnt_contain(result, "class")