openknowledge-archive / dpm-old

**DEPRECATED** - see https://github.com/frictionlessdata/. [[Data package manager (dpm) is a command line tool and Python library for working with data packages - http://data.okfn.org/standards/data-package/]]
http://dpm.readthedocs.org/
15 stars 8 forks source link

Fix the tests #37

Closed dgraziotin closed 12 years ago

dgraziotin commented 12 years ago

There are many tests that either fail or give errors.

dpm.tests.index.test_base.TestFileIndex.test_get ... ERROR
dpm.tests.index.test_base.TestFileIndex.test_search ... ERROR
dpm.tests.index.test_base.TestFileIndex.test_together_has_register_update_list ... ERROR
dpm.tests.index.test_base.TestSimpleIndex.test_get ... ok
dpm.tests.index.test_base.TestSimpleIndex.test_search ... ok
dpm.tests.index.test_base.TestSimpleIndex.test_together_has_register_update_list ... ok
dpm.tests.index.test_ckan.TestCkanIndex.test_get ... ok
dpm.tests.index.test_ckan.TestCkanIndex.test_search ... ERROR
Traceback (most recent call last):
  File "/usr/bin/nosetests", line 9, in 
    load_entry_point('nose==1.0.0', 'console_scripts', 'nosetests')()
  File "/usr/lib/pymodules/python2.7/nose/core.py", line 118, in __init__
    **extra_args)
  File "/usr/lib/python2.7/unittest/main.py", line 95, in __init__
    self.runTests()
  File "/usr/lib/pymodules/python2.7/nose/core.py", line 197, in runTests
    result = self.testRunner.run(self.test)
  File "/usr/lib/pymodules/python2.7/nose/core.py", line 61, in run
    test(result)
  File "/usr/lib/pymodules/python2.7/nose/suite.py", line 176, in __call__
    return self.run(*arg, **kw)
  File "/usr/lib/pymodules/python2.7/nose/suite.py", line 223, in run
    test(orig)
  File "/usr/lib/pymodules/python2.7/nose/suite.py", line 176, in __call__
    return self.run(*arg, **kw)
  File "/usr/lib/pymodules/python2.7/nose/suite.py", line 223, in run
    test(orig)
  File "/usr/lib/pymodules/python2.7/nose/suite.py", line 176, in __call__
    return self.run(*arg, **kw)
  File "/usr/lib/pymodules/python2.7/nose/suite.py", line 223, in run
    test(orig)
  File "/usr/lib/pymodules/python2.7/nose/suite.py", line 176, in __call__
    return self.run(*arg, **kw)
  File "/usr/lib/pymodules/python2.7/nose/suite.py", line 213, in run
    result.addError(self, self._exc_info())
  File "/usr/lib/pymodules/python2.7/nose/proxy.py", line 134, in addError
    plugins.addError(self.test, err)
  File "/usr/lib/pymodules/python2.7/nose/plugins/manager.py", line 94, in __call__
    return self.call(*arg, **kw)
  File "/usr/lib/pymodules/python2.7/nose/plugins/manager.py", line 162, in simple
    result = meth(*arg, **kw)
  File "/usr/lib/pymodules/python2.7/nose/plugins/manager.py", line 320, in addError
    return self.plugin.addError(test.test, err, capt)
AttributeError: 'ContextSuite' object has no attribute 'test'

We should either fix the tests or fix the bugs they encounter, if any. This situation exists at least since I knew about datapkg. Since a requirement to dpm "commits" is to create suitable tests and ensure that the commit does not break the system, we should have working tests.

rufuspollock commented 12 years ago

Absolutely agree here. All tests were passing on my machine as of a week or so ago. I'll check now and fix any I've broken.

I also note that tests that require external access need to be tagged as such so they can be excluded easily (to prevent hanging of tests when run without net access -- see nosetests command in README)

dgraziotin commented 12 years ago

Give me half an hour, I was already taking care of it. I will just send a pull request and you can fix anything else. I've seen that part, how do I tag a function using internet access?

dgraziotin commented 12 years ago
**external** = True
found it. Ok, I need to split test_lib in two modules then.
dgraziotin commented 12 years ago

Just noticed that there is another pull requests of mine that needs review. Therefore, I won't touch anything else. Please @rgrp review it here https://github.com/okfn/dpm/pull/38 If you pull it, then I will let you fix the remaining tests. I will just split mine and wait for you.