def test_inserts(self): result = fk.parse_docfiles(DOCFILESDIR, 'static') fk.insert_link_to_latest(result, '%(project)s/blah') for projinfo in result: gotlink = projinfo['versions'][-1]['link'] ideallink = '%s/blah' % projinfo['name'] self.assertEqual(gotlink, ideallink)
def test_inserts(self): result = fk.parse_docfiles(DOCFILESDIR, "static") fk.insert_link_to_latest(result, "%(project)s/blah") for projinfo in result: gotlink = projinfo["versions"][-1]["link"] ideallink = "%s/blah" % projinfo["name"] self.assertEqual(gotlink, ideallink)
def test_parses(self): result = fk.parse_docfiles(DOCFILESDIR, 'static') ideal = [ { 'name': 'project1', 'description': 'Project description.', 'versions': [ {'version': '1.0.1', 'link': 'static/project1/1.0.1/index.html'}, {'version': '1.2.0', 'link': 'static/project1/1.2.0/index.html'} ] }, { # Caps to test sorting 'name': 'Project2', 'description': fk.DEFAULT_PROJECT_DESCRIPTION, 'versions': [ {'version': '2.0.3', 'link': 'static/Project2/2.0.3/index.html'}, ] }, { 'name': 'project3', 'description': fk.DEFAULT_PROJECT_DESCRIPTION, 'versions': [ {'version': '3.3.3', 'link': 'static/project3/3.3.3/index.html'}, ] } ] self.assertEqual(result, ideal)
def test_parses(self): result = fk.parse_docfiles(DOCFILESDIR, "static") ideal = [ { "name": "project1", "description": "Project description.", "versions": [ {"version": "1.0.1", "link": "static/project1/1.0.1/index.html"}, {"version": "1.2.0", "link": "static/project1/1.2.0/index.html"}, ], }, { # Caps to test sorting "name": "Project2", "description": fk.DEFAULT_PROJECT_DESCRIPTION, "versions": [{"version": "2.0.3", "link": "static/Project2/2.0.3/index.html"}], }, { "name": "project3", "description": fk.DEFAULT_PROJECT_DESCRIPTION, "versions": [{"version": "3.3.3", "link": "static/project3/3.3.3/index.html"}], }, ] self.assertEqual(result, ideal)
def test_not_existing_dir(self): self.assertEqual(fk.parse_docfiles('balh blah blah', 'static'), {})
def test_not_existing_dir(self): self.assertEqual(fk.parse_docfiles("balh blah blah", "static"), {})