def resolve(self, uri): """ Banana banana """ return resolve(uri, self.project.include_paths)
def test_resolve_wrong_path(self): self.assertEqual(resolve('yep.x', []), None)
def test_resolve_different_lang(self): _ = self._create_src_file('yep.x', ['foo', 'bar', 'baz']) self.assertEqual(resolve('yep.x', [self._src_dir]), '\n``` x\nfoo\nbar\nbaz\n\n```\n')
def test_resolve_linenos(self): _ = self._create_md_file('yep.md', 'foo\nbar\nbaz\nfoobar\n') self.assertEqual(resolve('yep.md[1:3]', [self._md_dir]), 'bar\nbaz\n')
def test_resolve_wrong_linenos(self): _ = self._create_md_file('yep.md', 'stuff') self.assertEqual(resolve('yep.md[4:7:9]', [self._md_dir]), None) self.assertEqual(resolve('yep.md[4:7]', [self._md_dir]), None)
def test_resolve(self): _ = self._create_md_file('yep.md', 'stuff') self.assertEqual(resolve('yep.md', [self._md_dir]), 'stuff')