def test_duplicated_modules(self, search_paths): _subdir = os.path.join(self.tmpdir, 'modules') if not os.path.isdir(_subdir): os.makedirs(_subdir) foo = os.path.join(self.tmpdir, 'foo') with open(foo, 'w') as fp: print >> fp foo1 = os.path.join(self.tmpdir, 'foo') with open(foo1, 'w') as fp: print >> fp search_paths.return_value = [self.tmpdir, _subdir] runner = Runner() modules = runner.modules() self.assertIn('foo', modules) self.assertEquals(modules['foo'].fname, foo)
def test_modules(self, search_paths): _subdir = os.path.join(self.tmpdir, 'modules') if not os.path.isdir(_subdir): os.makedirs(_subdir) foo = os.path.join(self.tmpdir, 'foo') with open(foo, 'w') as fp: print >> fp bar = os.path.join(self.tmpdir, 'bar') with open(bar, 'w') as fp: print >> fp search_paths.return_value = [self.tmpdir, _subdir] runner = Runner() modules = runner.modules() self.assertIn('foo', modules) self.assertIn('bar', modules)